RtttlWriter.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * RtttlWriter.h - Support for reading RTTTL files
8  *
9  * RTTTL conversion code based on https://github.com/end2endzone/NonBlockingRTTTL
10  *
11  * @author Sept 2019 mikee47 <mike@sillyhouse.net>
12  *
13  ****/
14 
15 #pragma once
16 
17 #include "RtttlParser.h"
18 #include <Print.h>
19 
20 namespace RingTone
21 {
22 class RtttlWriter
23 {
24 public:
25  RtttlWriter(Print& out) : out(out)
26  {
27  }
28 
29  void beginTune(const RtttlHeader& header);
30  void addNote(const NoteDef& note);
31  void endTune();
32  void addComment(const String& text);
33 
34  void addTune(RtttlParser& parser);
35  void addAllTunes(RtttlParser& parser);
36 
37 private:
38  Print& out;
39  RtttlHeader header;
40  unsigned tuneCount = 0;
41  unsigned noteCount = 0;
42 };
43 
44 }; // namespace RingTone
Class to parse RTTTL files RTTTL (RingTone Text Transfer Language) format.
Definition: RtttlParser.h:68
The String class.
Definition: WString.h:136
Definition: RingTone.h:18
void beginTune(const RtttlHeader &header)
void addTune(RtttlParser &parser)
void addNote(const NoteDef &note)
Provides formatted output to stream.
Definition: Print.h:36
RtttlWriter(Print &out)
Definition: RtttlWriter.h:49
Definition: RtttlParser.h:35
void addAllTunes(RtttlParser &parser)
void addComment(const String &text)