Update of /cvsroot/audacity/audacity-src/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17223
Modified Files: LyricsWindow.cpp Menus.cpp Menus.h MixerBoard.cpp Log Message: + Renamed "Lyrics" to "Karaoke" in menu and window title bar. + Gale Andrews wrote: > One reason not to use Mixer Board is of course the screen > estate it uses. Have you considered a preference to have it > as a separate window that you can task switch between? > I know you can minimise it and task switch to get it back but > that is an extra step. Where you had (say) eight tracks so you > cannot see the waveforms and Mixer Board simultaneously > anyway, a separate window might be preferred by some. This was just a side-effect of having it be wxFRAME_FLOAT_ON_PARENT, so I've removed that. Downside is that if the MixerBoard is entirely in front of the main window, then doing anything in the main window causes it to be obscured. Added calls to Raise() and SetFocus() to the menu command handler, so you can bring it back with the menu command (or alt-tab). Did the same changes for Karaoke window. + Removed constraints on horizontal resize, and I think this fixes the issues Steve described. It still automatically resizes when you add or remove tracks, and is only as wide as necessary when maximized. Index: Menus.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/Menus.h,v retrieving revision 1.140 retrieving revision 1.141 diff -u -d -r1.140 -r1.141 --- Menus.h 9 Jul 2009 23:52:18 -0000 1.140 +++ Menus.h 29 Jul 2009 00:26:32 -0000 1.141 @@ -248,7 +248,7 @@ void OnHistory(); #ifdef EXPERIMENTAL_LYRICS_WINDOW - void OnLyrics(); + void OnKaraoke(); #endif #ifdef EXPERIMENTAL_MIXER_BOARD void OnMixerBoard(); Index: Menus.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v retrieving revision 1.505 retrieving revision 1.506 diff -u -d -r1.505 -r1.506 --- Menus.cpp 26 Jul 2009 13:18:28 -0000 1.505 +++ Menus.cpp 29 Jul 2009 00:26:32 -0000 1.506 @@ -530,7 +530,7 @@ AudioIONotBusyFlag | UndoAvailableFlag); #ifdef EXPERIMENTAL_LYRICS_WINDOW - c->AddItem(wxT("Lyrics"), _("&Lyrics..."), FN(OnLyrics), LabelTracksExistFlag, LabelTracksExistFlag); + c->AddItem(wxT("Karaoke"), _("&Karaoke..."), FN(OnKaraoke), LabelTracksExistFlag, LabelTracksExistFlag); #endif #ifdef EXPERIMENTAL_MIXER_BOARD c->AddItem(wxT("MixerBoard"), _("&Mixer Board..."), FN(OnMixerBoard), WaveTracksExistFlag, WaveTracksExistFlag); @@ -4161,12 +4161,13 @@ } #ifdef EXPERIMENTAL_LYRICS_WINDOW - void AudacityProject::OnLyrics() + void AudacityProject::OnKaraoke() { if (!mLyricsWindow) mLyricsWindow = new LyricsWindow(this); wxASSERT(mLyricsWindow); mLyricsWindow->Show(); + mLyricsWindow->Raise(); } #endif #ifdef EXPERIMENTAL_MIXER_BOARD @@ -4178,6 +4179,8 @@ mMixerBoard = mMixerBoardFrame->mMixerBoard; } mMixerBoardFrame->Show(); + mMixerBoardFrame->Raise(); + mMixerBoardFrame->SetFocus(); } #endif Index: LyricsWindow.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/LyricsWindow.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- LyricsWindow.cpp 9 Jul 2009 21:14:28 -0000 1.4 +++ LyricsWindow.cpp 29 Jul 2009 00:26:32 -0000 1.5 @@ -45,18 +45,14 @@ LyricsWindow::LyricsWindow(AudacityProject *parent): wxFrame(parent, -1, - wxString::Format(_("Audacity Lyrics%s"), + wxString::Format(_("Audacity Karaoke%s"), ((parent->GetName() == wxEmptyString) ? wxT("") : wxString::Format( wxT(" - %s"), parent->GetName().c_str()).c_str())), wxPoint(100, 300), gSize, - wxDEFAULT_FRAME_STYLE -#ifndef __WXMAC__ - | ((parent == NULL) ? 0x0 : wxFRAME_FLOAT_ON_PARENT) //vvvvv -#endif - ) + wxDEFAULT_FRAME_STYLE) { #ifdef __WXMAC__ // WXMAC doesn't support wxFRAME_FLOAT_ON_PARENT, so we do Index: MixerBoard.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/MixerBoard.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- MixerBoard.cpp 26 Jul 2009 02:44:50 -0000 1.12 +++ MixerBoard.cpp 29 Jul 2009 00:26:32 -0000 1.13 @@ -49,7 +49,8 @@ const int kGainSliderMax = 6; // headroom convention to match typical mixer boards layout enum { - ID_TOGGLEBUTTON_MUTE = 13000, + ID_MUSICAL_INSTRUMENT_IMAGE = 13000, + ID_TOGGLEBUTTON_MUTE, ID_TOGGLEBUTTON_SOLO, ID_ASLIDER_PAN, ID_SLIDER_GAIN, @@ -580,8 +581,10 @@ // class MixerBoard -#define MIXER_BOARD_MIN_HEIGHT 500 -#define MIXER_TRACK_CLUSTER_WIDTH 100 - kInset +#define MIXER_BOARD_MIN_HEIGHT 500 +#define MIXER_TRACK_CLUSTER_WIDTH 100 - kInset +#define MIXER_BOARD_MIN_WIDTH kDoubleInset + MIXER_TRACK_CLUSTER_WIDTH + kDoubleInset + BEGIN_EVENT_TABLE(MixerBoard, wxWindow) EVT_SIZE(MixerBoard::OnSize) @@ -694,9 +697,10 @@ { // Not already showing it. Add a new MixerTrackCluster. wxPoint clusterPos( - ((nClusterIndex * - (kInset + MIXER_TRACK_CLUSTER_WIDTH)) + // left margin and width for each to its left - kInset), // plus left margin for new cluster + (kInset + // extra inset to left for first one. + (nClusterIndex * + (kInset + MIXER_TRACK_CLUSTER_WIDTH)) + // left margin and width for each to its left + kInset), // plus left margin for new cluster kInset); wxSize clusterSize(MIXER_TRACK_CLUSTER_WIDTH, kClusterHeight); pMixerTrackCluster = @@ -735,9 +739,10 @@ int MixerBoard::GetTrackClustersWidth() { return + kInset + // extra margin at left for first one (mMixerTrackClusters.GetCount() * // number of tracks times - (kInset + MIXER_TRACK_CLUSTER_WIDTH)) + // left margin and width for each - kInset; // plus final right margin + (kInset + MIXER_TRACK_CLUSTER_WIDTH)) + // left margin and width for each + kDoubleInset; // plus final right margin } void MixerBoard::MoveTrackCluster(const WaveTrack* pLeftTrack, @@ -974,37 +979,17 @@ mPrevT1 = t1; } + void MixerBoard::UpdateWidth() { - // All these calculations have extra padding on right, so there's - // always gray area to click to deselect all tracks. - int newWidth = this->GetTrackClustersWidth() + kDoubleInset; + int newWidth = this->GetTrackClustersWidth(); // Min width is one cluster wide, plus margins. - const int kMinWidth = kInset + MIXER_TRACK_CLUSTER_WIDTH + kTripleInset; - if (newWidth < kMinWidth) - newWidth = kMinWidth; + if (newWidth < MIXER_BOARD_MIN_WIDTH) + newWidth = MIXER_BOARD_MIN_WIDTH; mScrolledWindow->SetVirtualSize(newWidth, -1); - - // Now limit newWidth to visible screen. - wxWindow* pParent = this->GetParent(); // In UmixIt, would be mProject. But here, always its MixerBoardFrame. - wxPoint parentPos = pParent->GetPosition(); - const int kMaxWidth = wxSystemSettings::GetMetric(wxSYS_SCREEN_X) - parentPos.x; - if (newWidth > kMaxWidth) - newWidth = kMaxWidth; - - int width; - int height; - pParent->GetSize(&width, &height); - if (newWidth == width) - return; // No need to update. - - pParent->SetSizeHints( - kMinWidth, // int minW=-1, - MIXER_BOARD_MIN_HEIGHT, // int minH=-1, - newWidth); // int maxW=-1, - pParent->SetSize(newWidth, -1); + this->GetParent()->SetSize(newWidth + kDoubleInset, -1); } // @@ -1252,7 +1237,6 @@ // this->FitInside() doesn't work, and it doesn't happen automatically. Is wxScrolledWindow wrong? mScrolledWindow->SetSize(evt.GetSize()); - this->UpdateWidth(); // primarily to update mScrolledWindow's virtual width for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++) mMixerTrackClusters[i]->UpdateHeight(); this->RefreshTrackClusters(false); @@ -1269,9 +1253,7 @@ // Default to fitting one track. const wxSize kDefaultSize = - wxSize((kInset + MIXER_TRACK_CLUSTER_WIDTH) + // left margin and width for one track. - kDoubleInset, // plus final right margin - MIXER_BOARD_MIN_HEIGHT); + wxSize(MIXER_BOARD_MIN_WIDTH, MIXER_BOARD_MIN_HEIGHT); MixerBoardFrame::MixerBoardFrame(AudacityProject* parent) : wxFrame(parent, -1, @@ -1281,16 +1263,11 @@ wxString::Format(wxT(" - %s"), parent->GetName().c_str()).c_str())), wxDefaultPosition, kDefaultSize, - wxDEFAULT_FRAME_STYLE - #ifndef __WXMAC__ - | ((parent == NULL) ? 0x0 : wxFRAME_FLOAT_ON_PARENT) - #endif - ) + wxDEFAULT_FRAME_STYLE) { mMixerBoard = new MixerBoard(parent, this, wxDefaultPosition, kDefaultSize); - this->SetSizeHints(kInset + MIXER_TRACK_CLUSTER_WIDTH, // int minW=-1, // Show at least one cluster wide. - MIXER_BOARD_MIN_HEIGHT); // int minH=-1, + this->SetSizeHints(MIXER_BOARD_MIN_WIDTH, MIXER_BOARD_MIN_HEIGHT); mMixerBoard->UpdateTrackClusters(); ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Audacity-cvs mailing list Audacity-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/audacity-cvs