Ejemplo n.º 1
0
void ControlToolBar::PlayDefault()
{
   if(mPlay->WasControlDown())
      PlayCurrentRegion(false, true); /* play with cut preview */
   else if(mPlay->WasShiftDown())
      PlayCurrentRegion(true); /* play looped */
   else
      PlayCurrentRegion(false); /* play normal */
}
Ejemplo n.º 2
0
void ControlToolBar::OnPlay(wxCommandEvent &evt)
{
	if(mAlwaysEnablePlay)
		StopPlaying();

   if(mPlay->WasShiftDown())
      PlayCurrentRegion(true);
   else
      PlayCurrentRegion(false);

   if(mAlwaysEnablePlay)
	   mPlay->PopUp();
}
Ejemplo n.º 3
0
void ControlToolBar::PlayDefault()
{
   // Let control have precedence over shift
   const bool cutPreview = mPlay->WasControlDown();
   const bool looped = !cutPreview &&
      mPlay->WasShiftDown();
   PlayCurrentRegion(looped, cutPreview);
}
Ejemplo n.º 4
0
   void ControlToolBar::OnLoopPlay(wxCommandEvent &evt)
   {
	   if(mAlwaysEnablePlay)
		   StopPlaying();

      PlayCurrentRegion(true);

      if(mAlwaysEnablePlay)
      {
	      mPlay->PopUp();
         mLoopPlay->PopUp();
      }
   }
Ejemplo n.º 5
0
void ControlToolBar::OnKeyEvent(wxKeyEvent & event)
{
   if (event.ControlDown() || event.AltDown()) {
      event.Skip();
      return;
   }

   if (event.GetKeyCode() == WXK_SPACE) {
      if (gAudioIO->IsStreamActive(GetActiveProject()->GetAudioIOToken())) {
         SetPlay(false);
         SetStop(true);
         StopPlaying();
      }
      else if (!gAudioIO->IsBusy()) {
         //SetPlay(true);// Not needed as done in PlayPlayRegion
         SetStop(false);
         PlayCurrentRegion();
      }
      return;
   }
   event.Skip();
}
Ejemplo n.º 6
0
void ControlToolBar::OnKeyEvent(wxKeyEvent & event)
{
   if (event.ControlDown() || event.AltDown()) {
      event.Skip();
      return;
   }

   // Does not appear to be needed on Linux. Perhaps on some other platform?
   // If so, "!CanStopAudioStream()" should probably apply.
   if (event.GetKeyCode() == WXK_SPACE) {
      if (gAudioIO->IsStreamActive(GetActiveProject()->GetAudioIOToken())) {
         SetPlay(false);
         SetStop(true);
         StopPlaying();
      }
      else if (!gAudioIO->IsBusy()) {
         //SetPlay(true);// Not needed as done in PlayPlayRegion
         SetStop(false);
         PlayCurrentRegion();
      }
      return;
   }
   event.Skip();
}
Ejemplo n.º 7
0
void ControlToolBar::OnKeyEvent(wxKeyEvent & event)
{
   if (event.ControlDown() || event.AltDown()) {
      event.Skip();
      return;
   }

   // Play/Stop
#if (AUDACITY_BRANDING == BRAND_AUDIOTOUCH)
   if (event.GetKeyCode() == WXK_RETURN) {
#else
   if (event.KeyCode() == WXK_SPACE) {
#endif
      if (gAudioIO->IsStreamActive(GetActiveProject()->GetAudioIOToken())) {
         SetPlay(false);
         SetStop(true);
         StopPlaying();
      }
      else if (!gAudioIO->IsBusy()) {
         SetPlay(true);
         SetStop(false);
         PlayCurrentRegion();
      }
      return;
   }
   event.Skip();
}

//void ControlToolBar::OnKeyUp(wxKeyEvent & event)
//{
//   #if (AUDACITY_BRANDING == BRAND_AUDIOTOUCH)
//      if ((event.KeyCode() == WXK_SPACE) && // Record
//            !mIsLocked)
//      {
//         StopPlaying();
//
//         SetPlay(false);
//         SetRecord(false);
//         SetStop(true);
//         mStop->Disable();
//      }
//   #endif
//   event.Skip();
//}
//
void ControlToolBar::UpdatePrefs()
{
	gPrefs->Read("/GUI/AlwaysEnablePlay", &mAlwaysEnablePlay, false);
#if 0
   gPrefs->Read("/GUI/AlwaysEnablePause", &mAlwaysEnablePause, false);

   if(mAlwaysEnablePause)
   {
      mPause->Enable();
      this->EnablePauseCommand(true);
   }
   else if(!mAlwaysEnablePause && !gAudioIO->IsBusy())
   {
      mPause->PopUp();
      mPause->Disable();
      this->EnablePauseCommand(false);

      mPaused = false;
      gAudioIO->SetPaused(false);
   }

   gAudioIO->SetAlwaysEnablePause(mAlwaysEnablePause);
#endif
}