|
From: <pst...@us...> - 2008-04-21 05:29:19
|
Revision: 471
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=471&view=rev
Author: pstieber
Date: 2008-04-20 22:29:17 -0700 (Sun, 20 Apr 2008)
Log Message:
-----------
Started adding a track settings dialog.
Added Paths:
-----------
trunk/jazz/src/Dialogs/TrackDialog.cpp
trunk/jazz/src/Dialogs/TrackDialog.h
Added: trunk/jazz/src/Dialogs/TrackDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/TrackDialog.cpp (rev 0)
+++ trunk/jazz/src/Dialogs/TrackDialog.cpp 2008-04-21 05:29:17 UTC (rev 471)
@@ -0,0 +1,125 @@
+//*****************************************************************************
+// The JAZZ++ Midi Sequencer
+//
+// Copyright (C) 2008 Peter J. Stieber, all rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//*****************************************************************************
+
+#include "WxWidgets.h"
+
+#include "TrackDialog.h"
+#include "../Track.h"
+#include "../Configuration.h"
+#include "../Globals.h"
+
+using namespace std;
+
+//*****************************************************************************
+//*****************************************************************************
+JZTrackDialog::JZTrackDialog(JZTrack& Track, wxWindow* pParent)
+ : wxDialog(pParent, wxID_ANY, wxString("Track Settings")),
+ mTrack(Track),
+ mpTrackNameEdit(0),
+ mpPatchListBox(0)
+{
+ mpTrackNameEdit = new wxTextCtrl(this, wxID_ANY);
+
+ mpPatchListBox = new wxListBox(this, wxID_ANY);
+ if (Track.IsDrumTrack())
+ {
+ const vector<pair<string, int> >& DrumNames = gpConfig->GetDrumNames();
+ for (
+ vector<pair<string, int> >::const_iterator iDrumName =
+ DrumNames.begin();
+ iDrumName != DrumNames.end();
+ ++iDrumName)
+ {
+ const string& DrumName = iDrumName->first;
+
+ if (!DrumName.empty())
+ {
+ mpPatchListBox->Append(DrumName.c_str());
+ }
+ }
+ }
+ else
+ {
+ const vector<pair<string, int> >& VoiceNames = gpConfig->GetVoiceNames();
+ for (
+ vector<pair<string, int> >::const_iterator iVoiceName =
+ VoiceNames.begin();
+ iVoiceName != VoiceNames.end();
+ ++iVoiceName)
+ {
+ const string& VoiceName = iVoiceName->first;
+
+ if (!VoiceName.empty())
+ {
+ mpPatchListBox->Append(VoiceName.c_str());
+ }
+ }
+ }
+
+ wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK");
+ wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel");
+ wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help");
+ pOkButton->SetDefault();
+
+ wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL);
+
+ pTopSizer->Add(
+ new wxStaticText(this, wxID_ANY, "Track Name:"),
+ 0,
+ wxALL,
+ 2);
+ pTopSizer->Add(mpTrackNameEdit, 0, wxGROW | wxALL, 2);
+
+ pTopSizer->Add(
+ new wxStaticText(this, wxID_ANY, "Patch:"),
+ 0,
+ wxALL,
+ 2);
+ pTopSizer->Add(mpPatchListBox, 0, wxGROW | wxALL, 2);
+
+ wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL);
+ pButtonSizer->Add(pOkButton, 0, wxALL, 5);
+ pButtonSizer->Add(pCancelButton, 0, wxALL, 5);
+ pButtonSizer->Add(pHelpButton, 0, wxALL, 5);
+
+ pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6);
+
+ SetAutoLayout(true);
+ SetSizer(pTopSizer);
+
+ pTopSizer->SetSizeHints(this);
+ pTopSizer->Fit(this);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool JZTrackDialog::TransferDataToWindow()
+{
+ mpTrackNameEdit->ChangeValue(mTrack.GetName());
+
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool JZTrackDialog::TransferDataFromWindow()
+{
+ return true;
+}
Property changes on: trunk/jazz/src/Dialogs/TrackDialog.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/jazz/src/Dialogs/TrackDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/TrackDialog.h (rev 0)
+++ trunk/jazz/src/Dialogs/TrackDialog.h 2008-04-21 05:29:17 UTC (rev 471)
@@ -0,0 +1,50 @@
+//*****************************************************************************
+// The JAZZ++ Midi Sequencer
+//
+// Copyright (C) 2008 Peter J. Stieber, all rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//*****************************************************************************
+
+#ifndef JZ_TRACKDIALOG_H
+#define JZ_TRACKDIALOG_H
+
+class JZTrack;
+class wxTextCtrl;
+
+//*****************************************************************************
+//*****************************************************************************
+class JZTrackDialog : public wxDialog
+{
+ public:
+
+ JZTrackDialog(JZTrack& Track, wxWindow* pParent);
+
+ private:
+
+ virtual bool TransferDataToWindow();
+
+ virtual bool TransferDataFromWindow();
+
+ private:
+
+ JZTrack& mTrack;
+
+ wxTextCtrl* mpTrackNameEdit;
+
+ wxListBox* mpPatchListBox;
+};
+
+#endif // !defined(JZ_TRACKDIALOG_H)
Property changes on: trunk/jazz/src/Dialogs/TrackDialog.h
___________________________________________________________________
Name: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|