00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef TSE3_CMD_PHRASE_H
00018 #define TSE3_CMD_PHRASE_H
00019 
00020 #include "tse3/cmd/Command.h"
00021 #include "tse3/Phrase.h"
00022 #include "tse3/DisplayParams.h"
00023 
00024 #include <vector>
00025 #include <string>
00026 
00027 namespace TSE3
00028 {
00029     class Phrase;
00030     class Song;
00031     class Part;
00032 
00033     namespace Cmd
00034     {
00049         class Phrase_SetInfo : public Command
00050         {
00051             public:
00052 
00066                 Phrase_SetInfo(TSE3::Phrase              *phrase,
00067                                const std::string         &title,
00068                                const TSE3::DisplayParams &dp);
00069 
00070             protected:
00071 
00075                 virtual void executeImpl();
00076 
00080                 virtual void undoImpl();
00081 
00082             private:
00083 
00084                 TSE3::Phrase        *phrase;
00085                 std::string          newTitle, oldTitle;
00086                 TSE3::DisplayParams  dp;
00087         };
00088 
00101         class Phrase_Create : public Command
00102         {
00103             public:
00104 
00115                 Phrase_Create(TSE3::PhraseList  *phraseList,
00116                               TSE3::PhraseEdit  *phraseEdit,
00117                               const std::string &title = "");
00118                 virtual ~Phrase_Create();
00119 
00124                 TSE3::Phrase *phrase() const { return newPhrase; }
00125 
00126             protected:
00127 
00131                 virtual void executeImpl();
00132 
00136                 virtual void undoImpl();
00137 
00138             private:
00139 
00140                 TSE3::PhraseList    *phraseList;
00141                 TSE3::PhraseEdit    *phraseEdit;
00142                 TSE3::Phrase        *newPhrase;
00143                 std::string          title;
00144         };
00145 
00154         class Phrase_Erase : public Command
00155         {
00156             public:
00157 
00171                 Phrase_Erase(TSE3::Phrase *phrase,
00172                              TSE3::Song   *song);
00173                 virtual ~Phrase_Erase();
00174 
00175             protected:
00176 
00180                 virtual void executeImpl();
00181 
00185                 virtual void undoImpl();
00186 
00187             private:
00188 
00189                 TSE3::Phrase              *phrase;
00190                 TSE3::Song                *song;
00191                 std::vector<TSE3::Part *>  parts;
00192                 bool                       vector_done;
00193         };
00194 
00195         
00196 
00197 
00198 
00199 
00200 
00201 
00202 
00203 
00204 
00205 
00206         class Phrase_Replace : public Command
00207         {
00208             public:
00209 
00224                 Phrase_Replace(TSE3::Phrase *oldPhrase,
00225                                TSE3::Phrase *newPhrase,
00226                                TSE3::Song   *song);
00227 
00242                 Phrase_Replace(TSE3::Phrase      *oldPhrase,
00243                                TSE3::PhraseEdit  *phraseEdit,
00244                                TSE3::Song        *song,
00245                                const std::string &title = "");
00246                 ~Phrase_Replace();
00247 
00255                 TSE3::Phrase *phrase() const { return newPhrase; }
00256 
00257             protected:
00258 
00262                 virtual void executeImpl();
00263 
00267                 virtual void undoImpl();
00268 
00269             private:
00270 
00271                 TSE3::Phrase              *newPhrase;
00272                 TSE3::Phrase              *oldPhrase;
00273                 TSE3::PhraseEdit          *phraseEdit;
00274                 TSE3::Song                *song;
00275                 std::string                newTitle;
00276                 std::vector<TSE3::Part *>  parts;
00277         };
00278     }
00279 }
00280 
00281 #endif