|
From: <pst...@us...> - 2008-04-06 02:15:05
|
Revision: 405
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=405&view=rev
Author: pstieber
Date: 2008-04-05 19:15:03 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
Started a metronome setting dialog.
Added Paths:
-----------
trunk/jazz/src/dialogs/MetronomeSettingsDialog.cpp
trunk/jazz/src/dialogs/MetronomeSettingsDialog.h
Added: trunk/jazz/src/dialogs/MetronomeSettingsDialog.cpp
===================================================================
--- trunk/jazz/src/dialogs/MetronomeSettingsDialog.cpp (rev 0)
+++ trunk/jazz/src/dialogs/MetronomeSettingsDialog.cpp 2008-04-06 02:15:03 UTC (rev 405)
@@ -0,0 +1,110 @@
+//*****************************************************************************
+// 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 "MetronomeSettingsDialog.h"
+
+#include "../Metronome.h"
+#include "../Knob.h"
+
+using namespace std;
+
+//*****************************************************************************
+//*****************************************************************************
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZMetronomeSettingsDialog::JZMetronomeSettingsDialog(wxWindow* pParent)
+ : wxDialog(pParent, wxID_ANY, wxString("Metronome Settings")),
+ mpSynthesizerListbox(0),
+ mpStartListbox(0)
+{
+ JZKnob* pKnob = new JZKnob(this, wxID_ANY, 100, 0, 128);
+
+ mpSynthesizerListbox = new wxListBox(this, wxID_ANY);
+
+ int Selection = 0;
+ int Index = 0;
+ for (
+ vector<pair<string, int> >::const_iterator iPair = gSynthesizerTypes.begin();
+ iPair != gSynthesizerTypes.end();
+ ++iPair, ++Index)
+ {
+ mpSynthesizerListbox->Append(iPair->first.c_str());
+ if (strcmp(iPair->first.c_str(), gpConfig->StrValue(C_SynthType)) == 0)
+ {
+ Selection = Index;
+ }
+ }
+ mpSynthesizerListbox->SetSelection(Selection);
+
+ mpStartListbox = new wxListBox(this, wxID_ANY);
+
+ mpStartListbox->Append("Never");
+ mpStartListbox->Append("Song Start");
+ mpStartListbox->Append("Start Play");
+
+ mpStartListbox->SetSelection(gpConfig->GetValue(C_SendSynthReset));
+
+ 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);
+ wxBoxSizer* pListControlSizer = new wxBoxSizer(wxHORIZONTAL);
+ wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL);
+
+ wxBoxSizer* pLeftSizer = new wxBoxSizer(wxVERTICAL);
+ wxBoxSizer* pRightSizer = new wxBoxSizer(wxVERTICAL);
+
+ pLeftSizer->Add(pKnob, 0, wxALL, 2);
+
+ pLeftSizer->Add(
+ new wxStaticText(this, wxID_ANY, "Synthesizer Type"),
+ 0,
+ wxALL,
+ 2);
+ pLeftSizer->Add(mpSynthesizerListbox, 0, wxGROW | wxALL, 2);
+
+ pRightSizer->Add(
+ new wxStaticText(this, wxID_ANY, "Send MIDI Reset"),
+ 0,
+ wxALL,
+ 2);
+ pRightSizer->Add(mpStartListbox, 0, wxALL, 2);
+
+ pListControlSizer->Add(pLeftSizer, 0, wxALL, 3);
+ pListControlSizer->Add(pRightSizer, 0, wxALL, 3);
+
+ pTopSizer->Add(pListControlSizer, 0, wxCENTER);
+
+ 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);
+}
Property changes on: trunk/jazz/src/dialogs/MetronomeSettingsDialog.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/jazz/src/dialogs/MetronomeSettingsDialog.h
===================================================================
--- trunk/jazz/src/dialogs/MetronomeSettingsDialog.h (rev 0)
+++ trunk/jazz/src/dialogs/MetronomeSettingsDialog.h 2008-04-06 02:15:03 UTC (rev 405)
@@ -0,0 +1,45 @@
+//*****************************************************************************
+// 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_METRONOMESETTINGDIALOG_H
+#define JZ_METRONOMESETTINGDIALOG_H
+
+class JZMetronomeInfo;
+
+//*****************************************************************************
+//*****************************************************************************
+class JZMetronomeSettingsDialog : public wxDialog
+{
+ public:
+
+ JZMetronomeSettingsDialog(
+ wxWindow* pParent,
+ JZMetronomeInfo& MetronomeInfo);
+
+ private:
+
+ JZMetronomeInfo& mMetronomeInfo;
+
+ wxListBox* mpSynthesizerListbox;
+
+ wxListBox* mpStartListbox;
+};
+
+#endif // !defined(JZ_METRONOMESETTINGDIALOG_H)
Property changes on: trunk/jazz/src/dialogs/MetronomeSettingsDialog.h
___________________________________________________________________
Name: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|