Shane,
Finally got a menu for the Selection Format. It's in the track
menu on the left side down at the bottom, called Set Selection
Format. There were changes to TrackPanel.cpp and TrackPanel.h to
do this. Below are the diffs to the two files and attached are
fully modified complete files in a .tar.gz file - based on using
TrackPanel.cpp and TrackPanel.h from CVS on Aug 29. Those two
files were dated from August 16, so unless someone has committed
something very recent, this should be good as is. A summary of
the changes is:
made integer iformat global within TrackPanel.cpp
added OnFormat[12345678]ID to enum list
added mSelectionMenu
added three lines to cross platform ifdef statements
(hopefully this won't be as bad as the lrint I put in before)
added event and handler OnSelectionChange
changed some comments in DisplaySelection
I believe there are four situations in which the selection information
is not updated - undo, redo, skip to start, and skip to end. But in
any situation that selection information is not updated and is needed,
just simply selecting the same format from Set Selection Format menu
forces the selection information to update since there is a call to
DisplaySelection in the event handler.
When I compile a clean cvs source from August 29, I get an error with
libsndfile. These changes compiled fine and everything worked with
the last cvs I had from recently, so that should be unrelated.
Greg
-------------- TrackPanel.h diffs ------------------------
147,148d146
< void OnSelectionChange(wxEvent &event);
<
301d298
< wxMenu *mSelectionMenu;
------------ TrackPanel.cpp diffs -----------------------
89,90d88
< int iformat = 1;
<
118,126d115
< OnFormat1ID,
< OnFormat2ID,
< OnFormat3ID,
< OnFormat4ID,
< OnFormat5ID,
< OnFormat6ID,
< OnFormat7ID,
< OnFormat8ID,
<
149d137
< EVT_MENU_RANGE(OnFormat1ID, OnFormat8ID, TrackPanel::OnSelectionChange)
203,212d190
< mSelectionMenu = new wxMenu();
< mSelectionMenu->Append(OnFormat1ID, "min:sec (from ruler)");
< mSelectionMenu->Append(OnFormat2ID, "sec (from ruler)");
< mSelectionMenu->Append(OnFormat3ID, "samples (44100 hardwired)");
< mSelectionMenu->Append(OnFormat4ID, "min:sec (44100 hardwired)");
< mSelectionMenu->Append(OnFormat5ID, "sec (44100 hardwired)");
< mSelectionMenu->Append(OnFormat6ID, "min:sec+samples (44100 hardwired)");
< mSelectionMenu->Append(OnFormat7ID, "sec+samples (44100 hardwired)");
< mSelectionMenu->Append(OnFormat8ID, "cdda sectors+bytes (44100 only)");
<
233,234d210
< mWaveTrackMenu->AppendSeparator();
< mWaveTrackMenu->Append(0, _("Set Selection Format"), mSelectionMenu);
1552d1527
< ::InsertMenu((OpaqueMenuHandle *) mSelectionMenu->GetHMenu(), -1);
1556d1530
< ::InsertMenu((MenuRef) mSelectionMenu->GetHMenu(), -1);
1566d1539
< ::DeleteMenu(mSelectionMenu->MacGetMenuId());
2668,2701d2640
< // GM: Handles selection from the Set Selection Format submenu
< // of the track menu.
< void TrackPanel::OnSelectionChange(wxEvent & event)
< {
< int id = event.GetId();
< switch (id) {
< case OnFormat1ID:
< iformat = 1;
< break;
< case OnFormat2ID:
< iformat = 2;
< break;
< case OnFormat3ID:
< iformat = 3;
< break;
< case OnFormat4ID:
< iformat = 4;
< break;
< case OnFormat5ID:
< iformat = 5;
< break;
< case OnFormat6ID:
< iformat = 6;
< break;
< case OnFormat7ID:
< iformat = 7;
< break;
< case OnFormat8ID:
< iformat = 8;
< break;
< }
< DisplaySelection();
< }
<
2930,2934c2869
< // iformat is a global variable defined near the top of
< // TrackPanel.cpp to a default value of 1. When event handler
< // TrackPanel::OnSelectionChange is called, iformat is changed.
< // The following line was previously used when iformat was hardwired.
< // int iformat = 4;
---
> int iformat = 4;
2972,2973c2907,2908
< // The lowest the selection will go is 0+0004 for a cursor
< // position and 0+0001 for a selection range.
---
> // The lowest the selection will go is 0+0004 since 1 sample
> // is 4 bytes of cd audio.
2981,2982d2915
< // When this gets fixed, remove "(44100 hardwired)" from Set Selection
Format
< // menu items. The menu item cdda sectors+bytes will always be for 44100
only.
|