00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _FM_FRAME_H_
00017 #define _FM_FRAME_H_
00018
00019
00020 #include "Loaders.h"
00021 #include <wx/frame.h>
00022 #include <wx/menu.h>
00023 #include <wx/scrolbar.h>
00024 #include <wx/toolbar.h>
00025 #include <wx/list.h>
00026 #include <wx/bitmap.h>
00027 #include <wx/icon.h>
00028 #include <wx/bmpbuttn.h>
00029 #include <wx/timer.h>
00030 #include <wx/list.h>
00031 #include <wx/splitter.h>
00032 #include <wx/checkbox.h>
00033 #include <wx/slider.h>
00034
00035
00039 class Frame;
00040 class Controls;
00041
00042
00050 class Area : public wxScrolledWindow {
00051 public:
00052 Area(wxWindow * parent, Frame * owner);
00053 ~Area();
00055 void OnPaint(wxPaintEvent & event);
00056 void OnScroll(wxScrollWinEvent & event);
00058 void OnLeftDown(wxMouseEvent & event);
00059 void OnRightDown(wxMouseEvent & event);
00060 void OnMotion(wxMouseEvent & event);
00061 void OnLeftUp(wxMouseEvent & event);
00062 void OnRightUp(wxMouseEvent & event);
00064 void OnRemove(wxCommandEvent & WXUNUSED(event));
00065 void OnCut(wxCommandEvent & WXUNUSED(event));
00066 void OnCopy(wxCommandEvent & WXUNUSED(event));
00067 void OnPaste(wxCommandEvent & WXUNUSED(event));
00068 void OnEmpty(wxCommandEvent & WXUNUSED(event));
00070 void Redraw();
00071 void Update();
00073 DECLARE_EVENT_TABLE()
00074 private:
00075 void update_sel(const int lastx, const int acx, const int lasty);
00076 bool get_track(const int acy, track_t * track);
00078 Frame * frame;
00080 wxPoint ll_down;
00081 bool left_down;
00082 wxPoint lr_down;
00083 bool right_down;
00085 wxMenu * menuEdit;
00086 };
00087
00088
00095 class VolumeSlider : public wxSlider {
00096 public:
00097 VolumeSlider(wxWindow * parent, const wxWindowID id, const track_t chan, const volume_t inivol);
00099 track_t GetChannel() const;
00100 private:
00101 track_t channel;
00102 };
00103
00104
00105 WX_DECLARE_LIST(VolumeSlider, VolumeSliders);
00106
00107
00114 class TrackControl : public wxPanel {
00115 public:
00116 TrackControl(Controls * owner, const track_t track);
00117 ~TrackControl();
00119 void OnMute(wxCommandEvent & event);
00120 void OnVolume(wxScrollEvent & event);
00121 void Update();
00123 DECLARE_EVENT_TABLE()
00124
00125 private:
00126 track_t trck;
00127 Controls * parent;
00128 wxStaticBox * box;
00129 wxStaticBoxSizer * sbox;
00131 wxCheckBox * mute;
00132 VolumeSliders volume;
00133 };
00134
00135 WX_DECLARE_LIST(TrackControl, TrackControls);
00136
00137
00144 class Controls : public wxScrolledWindow {
00145 public:
00146 Controls(wxWindow * parent);
00147 ~Controls();
00149 void Update();
00150 void OnScroll(wxScrollWinEvent & event);
00151 void OnResize(wxSizeEvent & event);
00153 DECLARE_EVENT_TABLE()
00154
00155 private:
00156 TrackControls controls;
00157 };
00158
00159
00166 class Frame : public wxFrame {
00167 public:
00168 Frame(const wxString & title);
00169 ~Frame();
00171 void OnClose(wxCloseEvent & event);
00172 void OnQuit(wxCommandEvent & WXUNUSED(event));
00173 void OnAbout(wxCommandEvent & WXUNUSED(event));
00174 void OnTips(wxCommandEvent & WXUNUSED(event));
00175 void OnNew(wxCommandEvent & WXUNUSED(event));
00176 void OnOpen(wxCommandEvent & WXUNUSED(event));
00177 void OnSave(wxCommandEvent & WXUNUSED(event));
00178 void OnSaveAs(wxCommandEvent & WXUNUSED(event));
00179 void OnRevert(wxCommandEvent & WXUNUSED(event));
00180 void OnRender(wxCommandEvent & WXUNUSED(event));
00181 void OnAdd(wxCommandEvent & WXUNUSED(event));
00182 void OnImport(wxCommandEvent & WXUNUSED(event));
00183 void OnSettings(wxCommandEvent & WXUNUSED(event));
00185 void OnPlay(wxCommandEvent & WXUNUSED(event));
00186 void OnPause(wxCommandEvent & WXUNUSED(event));
00187 void OnStop(wxCommandEvent & WXUNUSED(event));
00188 void OnZoomIn(wxCommandEvent & WXUNUSED(event));
00189 void OnZoomOut(wxCommandEvent & WXUNUSED(event));
00191 bool SaveDlg();
00192 bool SaveAsDlg();
00194 void OnTimer(wxTimerEvent & event);
00196 void ShowTips(const bool force);
00198 void Update();
00199 enum status_t ChooseLoader(wxFile * file, const wxString & filename, Loader * * ld);
00201 DECLARE_EVENT_TABLE()
00202
00203 private:
00204 bool load(const wxString & fname);
00205 bool save(const wxString & fname);
00207 Area * area;
00208 Controls * controls;
00209 wxTimer * timer;
00210 wxSplitterWindow * split;
00211 wxMenuBar * menuBar;
00212 wxMenu * menuFile;
00213 wxMenu * menuEdit;
00214 wxMenu * menuTracks;
00215 wxMenu * menuOptions;
00216 wxMenu * menuHelp;
00217 wxBitmapButton * playBut;
00218 wxBitmapButton * pauseBut;
00219 wxBitmapButton * stopBut;
00220 wxBitmapButton * recordBut;
00221 wxBitmapButton * zoomInBut;
00222 wxBitmapButton * zoomOutBut;
00223 wxToolBar * toolBar;
00224 };
00225
00226 #endif