From: <pst...@us...> - 2010-07-19 14:13:01
|
Revision: 824 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=824&view=rev Author: pstieber Date: 2010-07-19 14:12:52 +0000 (Mon, 19 Jul 2010) Log Message: ----------- Changed MIDI file opening and saving from "File | Open..." and "File | Save" to "File | Import MIDI..." and "File | Export as MIDI...". I eventually want to put other settings in the Jazz++ project file. Modified Paths: -------------- trunk/jazz/src/Project.cpp trunk/jazz/src/Project.h trunk/jazz/src/Resources.h trunk/jazz/src/TrackFrame.cpp trunk/jazz/src/TrackFrame.h Modified: trunk/jazz/src/Project.cpp =================================================================== --- trunk/jazz/src/Project.cpp 2010-07-18 22:05:43 UTC (rev 823) +++ trunk/jazz/src/Project.cpp 2010-07-19 14:12:52 UTC (rev 824) @@ -513,14 +513,14 @@ // exists! // // Inputs: -// const wxString& SongFileName: +// const wxString& MidiFileName: // Song path and file name. //----------------------------------------------------------------------------- -void JZProject::Save(const wxString& SongFileName) +void JZProject::ExportMidiFile(const wxString& MidiFileName) { JZStandardWrite Io; - Write(Io, SongFileName); - mpConfig->Put(C_StartUpSong, SongFileName.c_str()); + Write(Io, MidiFileName); + mpConfig->Put(C_StartUpSong, MidiFileName.c_str()); } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Project.h =================================================================== --- trunk/jazz/src/Project.h 2010-07-18 22:05:43 UTC (rev 823) +++ trunk/jazz/src/Project.h 2010-07-19 14:12:52 UTC (rev 824) @@ -118,9 +118,9 @@ // already exists! // // Inputs: - // const wxString& SongFileName: - // Song path and file name. - void Save(const wxString& SongFileName); + // const wxString& MidiFileName: + // MIDI file path and file name. + void ExportMidiFile(const wxString& MidiFileName); // Here is the new play interface. For now it just acts as a layer // between the Project and the GUI. Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2010-07-18 22:05:43 UTC (rev 823) +++ trunk/jazz/src/Resources.h 2010-07-19 14:12:52 UTC (rev 824) @@ -32,8 +32,9 @@ #define ID_FILE_REVERT_TO_SAVED wxID_HIGHEST + 1 -#define ID_EXPORT_MIDI wxID_HIGHEST + 2 -#define ID_EXPORT_SELECTION_AS_MIDI wxID_HIGHEST + 3 +#define ID_IMPORT_MIDI wxID_HIGHEST + 2 +#define ID_EXPORT_MIDI wxID_HIGHEST + 3 +#define ID_EXPORT_SELECTION_AS_MIDI wxID_HIGHEST + 4 #define ID_SETTINGS_METRONOME wxID_HIGHEST + 10 #define ID_SETTINGS_SYNTHESIZER wxID_HIGHEST + 11 Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2010-07-18 22:05:43 UTC (rev 823) +++ trunk/jazz/src/TrackFrame.cpp 2010-07-19 14:12:52 UTC (rev 824) @@ -79,10 +79,20 @@ EVT_MENU(wxID_NEW, JZTrackFrame::OnFileNew) - EVT_MENU(wxID_OPEN, JZTrackFrame::OnFileOpen) + EVT_MENU(wxID_OPEN, JZTrackFrame::OnFileOpenProject) - EVT_MENU(wxID_SAVEAS, JZTrackFrame::OnFileSaveAs) + EVT_MENU(wxID_SAVE, JZTrackFrame::OnFileProjectSave) + EVT_MENU(wxID_SAVEAS, JZTrackFrame::OnFileProjectSaveAs) + + EVT_MENU(ID_IMPORT_MIDI, JZTrackFrame::OnFileImportMidi) + + EVT_MENU(ID_EXPORT_MIDI, JZTrackFrame::OnFileExportMidi) + + EVT_MENU( + ID_EXPORT_SELECTION_AS_MIDI, + JZTrackFrame::OnFileExportSelectionAsMidi) + EVT_MENU(wxID_EXIT, JZTrackFrame::OnFileExit) EVT_MENU(ID_PLAY, JZTrackFrame::OnPlay) @@ -218,17 +228,19 @@ mpFileMenu = new wxMenu; mpFileMenu->Append(wxID_NEW, "&New"); - mpFileMenu->Append(wxID_OPEN, "&Open..."); + mpFileMenu->Append(wxID_OPEN, "&Open Project..."); mpFileMenu->Append(wxID_CLOSE, "&Close"); mpFileMenu->Append(wxID_SAVE, "&Save Project"); mpFileMenu->Append(wxID_SAVEAS, "Save Project &As..."); mpFileMenu->AppendSeparator(); - mpFileMenu->Append(ID_EXPORT_MIDI, "Export as Midi..."); + mpFileMenu->Append(ID_IMPORT_MIDI, "Import MIDI..."); + + mpFileMenu->Append(ID_EXPORT_MIDI, "Export as MIDI..."); mpFileMenu->Append( ID_EXPORT_SELECTION_AS_MIDI, - "Export Selection as Midi..."); + "Export Selection as MIDI..."); mpFileMenu->AppendSeparator(); @@ -472,11 +484,26 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZTrackFrame::OnFileOpen(wxCommandEvent& Event) +void JZTrackFrame::OnFileOpenProject(wxCommandEvent& Event) { - // Use an open dialog to find the Jazz++ configuration file. - // wxFD_CHANGE_DIR - Change the current working directory to the directory - // where the file(s) chosen by the user are. +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTrackFrame::OnFileProjectSave(wxCommandEvent& Event) +{ +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTrackFrame::OnFileProjectSaveAs(wxCommandEvent& Event) +{ +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTrackFrame::OnFileImportMidi(wxCommandEvent& Event) +{ wxFileDialog OpenDialog( 0, "Load MIDI File", @@ -486,9 +513,9 @@ wxFD_OPEN | wxFD_CHANGE_DIR); if (OpenDialog.ShowModal() == wxID_OK) { - wxString FileName = OpenDialog.GetPath(); - gpProject->OpenSong(FileName); - SetTitle(FileName); + wxString MidiFileName = OpenDialog.GetPath(); + gpProject->OpenSong(MidiFileName); + SetTitle(MidiFileName); // NextWin->NewPosition(1, 0); mpTrackWindow->SetScrollRanges(); // mpTrackWindow->SetScrollPosition(0, 0); @@ -500,7 +527,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZTrackFrame::OnFileSaveAs(wxCommandEvent& Event) +void JZTrackFrame::OnFileExportMidi(wxCommandEvent& Event) { // wxFD_OVERWRITE_PROMPT - For save dialog only: prompt for a confirmation // if a file will be overwritten. @@ -514,13 +541,19 @@ if (SaveAsDialog.ShowModal() == wxID_OK) { wxString FileName = SaveAsDialog.GetPath(); - gpProject->Save(FileName); + gpProject->ExportMidiFile(FileName); SetTitle(FileName); } } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZTrackFrame::OnFileExportSelectionAsMidi(wxCommandEvent& Event) +{ +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZTrackFrame::OnFileExit(wxCommandEvent& Event) { if (OnClose() == false) Modified: trunk/jazz/src/TrackFrame.h =================================================================== --- trunk/jazz/src/TrackFrame.h 2010-07-18 22:05:43 UTC (rev 823) +++ trunk/jazz/src/TrackFrame.h 2010-07-19 14:12:52 UTC (rev 824) @@ -72,10 +72,18 @@ void OnFileNew(wxCommandEvent& Event); - void OnFileOpen(wxCommandEvent& Event); + void OnFileOpenProject(wxCommandEvent& Event); - void OnFileSaveAs(wxCommandEvent& Event); + void OnFileProjectSave(wxCommandEvent& Event); + void OnFileProjectSaveAs(wxCommandEvent& Event); + + void OnFileImportMidi(wxCommandEvent& Event); + + void OnFileExportMidi(wxCommandEvent& Event); + + void OnFileExportSelectionAsMidi(wxCommandEvent& Event); + void OnFileExit(wxCommandEvent& Event); void OnZoomIn(wxCommandEvent& Event); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |