예제 #1
0
void CMsgForm::OnTimer(UINT nIDEvent) 
{
	// TODO: この位置にメッセージ ハンドラ用のコードを追加するかまたはデフォルトの処理を呼び出してください

	if (nIDEvent == ID_TIMER_MSGFORM) {
		m_stPlayChk.lngPassTime++;	// タイマー経過時間を更新
		/// 再生時のプログレスバー更新
		int intPos, intLow, intUpper;
		if (m_pAudio->IsPlaying()) {
			if (!m_pAudio->IsPlayPause()) {
				intPos = m_Prog.GetPos();
				m_Prog.GetRange(intLow, intUpper);
				if (intPos < intUpper) {
					m_Prog.StepIt();
				} else {
					/// 再生終了
					PlayStop();
				}
			}
		} else {
			/// 再生終了
			PlayStop();
			/// プログレスバーをフルに(見た目)
			m_Prog.GetRange(intLow, intUpper);
			m_Prog.SetPos(intUpper);
		}
	}
	
	TVisualFormView::OnTimer(nIDEvent);
}
예제 #2
0
void SetSignatureCurrPos(struct Tracker_Windows *window){
	struct WBlocks *wblock=window->wblock;
	int curr_realline=wblock->curr_realline;
	Place *place= &wblock->reallines[curr_realline]->l.p;
	char *signaturestring = GFX_GetString(window,NULL,"New Time Signature: >");
	if(signaturestring==NULL) return;

        Rational rational = create_rational_from_string(signaturestring);
        if (rational.is_valid()==false || rational.numerator<=0 || rational.denominator<=0)
          return;
        
	PlayStop();

	Undo_Signatures_CurrPos(window);

	SetSignature(wblock->block,place,rational.get_ratio());

        UpdateWBlockCoordinates(window, wblock);
          
        //UpdateWBlockWidths(window, wblock);
        
	//UpdateWSignatures(window,wblock);
	//DrawSignatures(window,wblock,curr_realline,curr_realline);

        wblock->block->is_dirty = true;

	//WBLOCK_DrawTempoColor(window,wblock,curr_realline,wblock->num_reallines);
}
예제 #3
0
// TODO/FIX: Implement
void RemoveAllTempoNodesOnReallineCurrPos(struct Tracker_Windows *window){

#if !USE_OPENGL

  struct WBlocks *wblock=window->wblock;
	WTempoNodes *wtemponode;
	int realline=wblock->curr_realline;

	PlayStop();

	Undo_TempoNodes_CurrPos(window);

	wtemponode=wblock->wtemponodes[realline];

	while(wtemponode!=NULL){
		if(wtemponode->type==TEMPONODE_NODE)
			ListRemoveElement3(&wblock->block->temponodes,(struct ListHeader3 *)wtemponode->pointer);
		wtemponode=wtemponode->next;
	}

	LegalizeTempoNodes(wblock->block);

	UpdateWTempoNodes(window,wblock);

	DrawUpWTempoNodes(window,wblock);
	UpdateSTimes(wblock->block);
#endif
}
예제 #4
0
void DeleteBlock_CurrPos(
	struct Tracker_Windows *window
){
	struct WBlocks *wblock=window->wblock;
	NInt blockpos;

	PlayStop();

	if(wblock->l.next==NULL && wblock==window->wblocks) return;

	blockpos=window->wblock->l.num;

	Undo_Block_Delete(blockpos);

	DeleteBlock(blockpos);

	wblock=ListFindElement1_r0(&window->wblocks->l,blockpos);

	if(wblock==NULL){
		wblock=ListLast1(&window->wblocks->l);
	}

	SelectWBlock(window,wblock);

	BS_UpdateBlockList();
	BS_UpdatePlayList();
}
예제 #5
0
bool Quit(struct Tracker_Windows *window){
        PlayStop();

	printf("Going to quit\n");

        return Undo_are_you_shure_questionmark();
}
예제 #6
0
// Note that it's perfectly fine calling PlayStop() between calling PC_Pause and PC_StopPause. PC_StopPause will still work as it's supposed to.
void PC_Pause(void){
  R_ASSERT(THREADING_is_main_thread());

  //printf("   000 Enter pause %d\n", g_pausing_level);

  g_pausing_level++;

  //printf("   Enter pause %d\n", g_pausing_level);
  
  if (g_pausing_level > 1)
    return;
  
  g_was_playing = false;
  g_playtype = 0;
  g_was_playing_range = false;
  
  if (is_playing()){

    if(ATOMIC_GET(is_starting_up)==false){
      struct Tracker_Windows *window = root->song->tracker_windows;
      window->message = "Temporarily stopping player";
      window->message_duration_left = 100;
    }

    g_playtype = pc->playtype;
    g_was_playing_range = pc->is_playing_range;
    PlayStop();
    g_was_playing = true;
  }  
}
예제 #7
0
파일: fxlines.c 프로젝트: erdoukki/radium
void AddFXNodeLineCurrMousePos(struct Tracker_Windows *window){
  struct WBlocks *wblock = window->wblock;
  float x = tevent.x;
  float y = tevent.y;
  struct WTracks *wtrack = WTRACK_get(wblock, x);
  if (wtrack==NULL)
    return;
  
  Place place;
  
  GetReallineAndPlaceFromY(window,
                           wblock,
                           y,
                           &place,
                           NULL,
                           NULL
                           );

  PlayStop();
  
  struct FX *fx=selectFX(window,wblock,wtrack);
  if(fx==NULL)
    return;

  int val = scale(x, wtrack->fxarea.x, wtrack->fxarea.x2, fx->min, fx->max);
                  
  AddFXNodeLineCurrPosInternal(window, wblock, wtrack, fx, &place, val);
}
예제 #8
0
void InsertTracks_CurrPos(
	struct Tracker_Windows *window,
	NInt toinsert
){
	struct WBlocks *wblock;
	NInt curr_track;

	PlayStop();

	curr_track=window->curr_track;
	if(curr_track<0) return;

	Undo_Block_CurrPos(window);

	wblock=window->wblock;

	InsertTracks(window,wblock,curr_track,toinsert);

	if(curr_track>=wblock->block->num_tracks){
		curr_track=wblock->block->num_tracks-1;
	}

	SetCursorPosConcrete(window,wblock,0,-1);

#if !USE_OPENGL
	UpdateAllFXNodeLines(window,wblock);
#endif
	SetCursorPosConcrete(window,wblock,curr_track,-1);

	window->must_redraw = true;

}
예제 #9
0
파일: fxlines.c 프로젝트: erdoukki/radium
void AddFXNodeLineCurrPos(struct Tracker_Windows *window, struct WBlocks *wblock, struct WTracks *wtrack){
  PlayStop();
  
  struct FX *fx=selectFX(window,wblock,wtrack);
  if(fx==NULL) return;

  Place place;
  PlaceCopy(&place, &wblock->reallines[wblock->curr_realline]->l.p);

  int val = (fx->max + fx->min)/2;

  AddFXNodeLineCurrPosInternal(window, wblock, wtrack, fx, &place, val);
}
예제 #10
0
void Block_Properties_CurrPos(
	struct Tracker_Windows *window
){
	NInt num_tracks;
	int num_lines;
	char seltext[500];
	char *blockname;
	ReqType reqtype;

	struct WBlocks *wblock=window->wblock;
	struct Blocks *block=wblock->block;

	PlayStop();

	reqtype=GFX_OpenReq(window,33,5,"Block Properties");

	sprintf(seltext,"Number of tracks (now %d): ",wblock->block->num_tracks);
	num_tracks=GFX_GetInteger(window,reqtype,seltext,2,200);
	if(num_tracks==1) num_tracks=wblock->block->num_tracks;

	sprintf(seltext,"Number of lines (now %d): ",wblock->block->num_lines);
	num_lines=GFX_GetInteger(window,reqtype,seltext,2,2000);
	if(num_lines==1) num_lines=wblock->block->num_lines;

	sprintf(seltext,"Name (now: '%s'): ",wblock->block->name);
	blockname=GFX_GetString(window,reqtype,seltext);
	if(blockname!=NULL){
		wblock->block->name=blockname;
		BS_UpdateBlockList();
		BS_UpdatePlayList();
	}

	GFX_CloseReq(window,reqtype);

	if(num_tracks==wblock->block->num_tracks && num_lines==wblock->block->num_lines){
		return;
	}

	Undo_Block_CurrPos(window);

	Block_Properties(block,num_tracks,num_lines);

	window=root->song->tracker_windows;
	while(window!=NULL){
		window->must_redraw = true;
		window=NextWindow(window);
	}

}
예제 #11
0
void CB_CutTrack_CurrPos(
	struct Tracker_Windows *window
){
	struct WBlocks *wblock=window->wblock;
	struct Blocks *block=wblock->block;
	struct WTracks *wtrack=wblock->wtrack;

	PlayStop();

        Undo_Track_CurrPos(window);

        if (wtrack != NULL)
          cb_fxs = CB_CutFx(wblock, wtrack);

        window->must_redraw=true;
}
예제 #12
0
void setBPM(int bpm_value){
  if (bpm_value <=1)
    return;
  if (bpm_value == root->tempo)
    return;

  PlayStop();

  struct Tracker_Windows *window = root->song->tracker_windows;
  struct WBlocks *wblock = window->wblock;
  
  Undo_MainTempo(window,wblock);
  
  root->tempo=bpm_value;
  UpdateAllSTimes();
}
예제 #13
0
    void timerEvent(QTimerEvent * e){
      printf("clicked: %p\n", parent->msgBox->clickedButton());

      if (parent->msgBox->clickedButton()!=NULL){
        SOUNDFILESAVER_request_stop();

        // Reset clickedButton().
        delete parent->msgBox;
        parent->msgBox = new MyQMessageBox;
      }
      
      const char *message = ATOMIC_GET(async_message);
      if(message != NULL){
        
        ATOMIC_SET(async_message, NULL);

        MIXER_request_stop_saving_soundfile(); // This is very messy. The code would be far simpler if jack_set_freewheel could be called from any thread.

        //usleep(1000*100); // Wait a bit for saving to stop;

        ScrollEditorToRealLine_CurrPos(root->song->tracker_windows, root->song->tracker_windows->wblock->bot_realline);
        root->song->tracker_windows->must_redraw = true;
#if 0        
        MyQMessageBox msgBox;
        
        msgBox->setText(QString(message));
        //msgBox->setInformativeText(message);
        msgBox->setStandardButtons(QMessageBox::Ok);

        safeExec(msgBox);
#endif

        bool was_cancelled = !strcmp(message, "Cancelled");
        
        V_free((void*)message);

        stop();

        parent->clean_prev();
        
        if (was_cancelled)
          PlayStop(); // Sometimes it continues playing after pressing "cancel".
        else
          parent->save_next();
      }
    }
예제 #14
0
void PC_Pause(void){

  if( ! is_playing()){
    return;					// There is only two threads, so its impossible to start playing
									// before PC_StopPause is called.
  }

#ifdef NOPAUSEPLAY
	PlayStop();
#else
	PausePlayer();				// Will not return before the player has really paused.

	PC_ReturnElements_fromPlayPos(pc->playpos);

	(*Ptask2MtaskCallBack)();
#endif
}
예제 #15
0
void setSignature(int numerator, int denominator){
  if (numerator<=0 || denominator<=0)
    return;
  if (numerator==root->signature.numerator && denominator==root->signature.denominator)
    return;
  
  PlayStop();

  struct Tracker_Windows *window = root->song->tracker_windows;
  struct WBlocks *wblock = window->wblock;

  Undo_MainTempo(window,wblock);
  
  root->signature = ratio(numerator, denominator);
  UpdateAllBeats();
  
  window->must_redraw = true;
}
예제 #16
0
void AddTempoNodeCurrPos(struct Tracker_Windows *window,float reltempo){
	struct WBlocks *wblock=window->wblock;

	PlayStop();

	AddTempoNode(
		window,wblock,
		&wblock->reallines[wblock->curr_realline]->l.p,
		reltempo
	);

#if !USE_OPENGL
	UpdateWTempoNodes(window,wblock);

	DrawUpWTempoNodes(window,wblock);
	UpdateSTimes(wblock->block);
#endif
}
예제 #17
0
파일: fxlines.c 프로젝트: erdoukki/radium
void DeleteFxNodeLine(struct WTracks *wtrack, struct FXs *fxs, struct FXNodeLines *fxnodeline){

  R_ASSERT(ListFindNumElements3(&fxs->fxnodelines->l)>1);

  PLAYER_lock();{
    ListRemoveElement3(&fxs->fxnodelines,&fxnodeline->l);
  }PLAYER_unlock();

  if (ListFindNumElements3(&fxs->fxnodelines->l) <= 1 ){
    PlayStop();

    struct FX *fx = fxs->fx;
    struct Tracks *track = wtrack->track;
    
    OS_SLIDER_release_automation_pointers(track->patch,fx->effect_num);
    (*fx->closeFX)(fx,track);
    ListRemoveElement1(&track->fxs,&fxs->l);
  }
}
예제 #18
0
void setLPB(int lpb_value){
  if (lpb_value <=1)
    return;
  if (lpb_value == root->lpb)
    return;
  
  PlayStop();

  struct Tracker_Windows *window = root->song->tracker_windows;
  struct WBlocks *wblock = window->wblock;

  printf("Undo MainTempo lpb: %d\n",lpb_value);
  Undo_MainTempo(window,wblock);
  
  root->lpb=lpb_value;
  UpdateAllSTimes();
  UpdateAllBeats();
  
  //UpdateAllWLPBs(window);
  window->must_redraw = true;
}
예제 #19
0
bool SOUNDFILESAVER_save(const char *filename, enum SOUNDFILESAVER_what what_to_save, float samplerate, int libsndfile_format, float post_recording_length, const char **error_string){

  PlayStop();

  {
    SF_INFO sf_info; memset(&sf_info,0,sizeof(sf_info));
    
    sf_info.samplerate = samplerate;
    sf_info.channels = 2;
    sf_info.format = libsndfile_format;
    
    {
      g_sndfile = sf_open(filename,SFM_WRITE,&sf_info);
      if(g_sndfile==NULL){
        printf("Why: \"%s\"\n",sf_strerror(NULL));
        if(error_string!=NULL)
          *error_string = sf_strerror(NULL);
        return false;
      }
    }
  }

  g_saving_was_successful = true;
  g_filename = talloc_strdup(filename);
  g_post_writing_left = post_recording_length;

  g_save_state=BEFORE_WRITING; PaUtil_FullMemoryBarrier();
  {
    MIXER_start_saving_soundfile();
    if(what_to_save==SAVE_SONG)
      PlaySongFromStart(root->song->tracker_windows);
    else
      PlayBlockFromStart(root->song->tracker_windows,false);
  }
  PaUtil_FullMemoryBarrier(); g_save_state=IS_WRITING;

  return true;
}
예제 #20
0
void RemoveSignaturesCurrPos(struct Tracker_Windows *window){
	struct WBlocks *wblock=window->wblock;
	int curr_realline=wblock->curr_realline;

	Place p1,p2;

	PlayStop();

	Undo_Signatures_CurrPos(window);

	PlaceSetReallinePlace(wblock,curr_realline,&p1);
	PlaceSetReallinePlace(wblock,curr_realline+1,&p2);

	RemoveSignatures(wblock->block,&p1,&p2);

        UpdateWBlockCoordinates(window, wblock);
        
        //UpdateWBlockWidths(window, wblock);
        
	//UpdateWSignatures(window,wblock);
	//UpdateSTimes(wblock->block);

        wblock->block->is_dirty = true;
}
예제 #21
0
void CB_PasteTrack_CurrPos(struct Tracker_Windows *window){
	struct WBlocks *wblock=window->wblock;
	struct Blocks *block=wblock->block;
	struct WTracks *wtrack=wblock->wtrack;
	Place lastplace;

	PlayStop();

	PlaceSetLastPos(wblock->block,&lastplace);

	switch(window->curr_track){
		case LPBTRACK:
			if(cb_lpb==NULL) return;
			Undo_LPBs_CurrPos(window);
			block->lpbs=CB_CopyLPBs(cb_lpb);
			CutListAt_a(&block->lpbs,&lastplace);
			UpdateSTimes(block);
                        UpdateBeats(block);
			UpdateWLPBs(window,wblock);
#if !USE_OPENGL
			DrawUpLPBs(window,wblock);
#endif
			break;
		case TEMPOTRACK:
			if(cb_tempo==NULL) return;
			Undo_Tempos_CurrPos(window);
			block->tempos=CB_CopyTempos(cb_tempo);
			CutListAt_a(&block->tempos,&lastplace);
			//UpdateWTempos(window,wblock);
#if !USE_OPENGL
			DrawUpTempos(window,wblock);
#endif
			UpdateSTimes(block);
			break;
		case TEMPONODETRACK:
			if(cb_temponode==NULL) return;
			Undo_TempoNodes_CurrPos(window);
			block->temponodes=CB_CopyTempoNodes(cb_temponode);
			CutListAt_a(&block->temponodes,&lastplace);
			LegalizeTempoNodes(block);
#if !USE_OPENGL
			UpdateWTempoNodes(window,wblock);
			DrawUpWTempoNodes(window,wblock);
#endif
			UpdateSTimes(block);
			break;
		default:
			if(cb_wtrack==NULL) return;
			Undo_Track_CurrPos(window);
			if(window->curr_track_sub==-1){
				if(CB_PasteTrack(wblock,cb_wtrack,wtrack)){
#if !USE_OPENGL
					UpdateFXNodeLines(window,wblock,wtrack);
#endif
					window->must_redraw = true;
				}else{
#if !USE_OPENGL
					UpdateAndClearSomeTrackReallinesAndGfxWTracks(
						window,
						wblock,
						window->curr_track,
						window->curr_track
					);
#endif
				}
			}else{
				if(CB_PasteTrackFX(wblock,cb_wtrack,wtrack)){
#if !USE_OPENGL
                                  UpdateFXNodeLines(window,wblock,wtrack);
#endif
					window->must_redraw = true;
				}else{
#if !USE_OPENGL
					UpdateAndClearSomeTrackReallinesAndGfxWTracks(
						window,
						wblock,
						window->curr_track,
						window->curr_track
					);
#endif
				}
			}
			break;
	}

        SetNoteSubtrackAttributes(wtrack->track);
        ValidateCursorPos(window);
}
예제 #22
0
void CMsgForm::OnBtnStop()
{
	PlayStop();
}
예제 #23
0
//
//  機能     : 画面の更新
//  
//  機能説明 : 
//  
//  返り値   : BOOL
//  
//  備考     : 
//  
BOOL CMsgForm::UpdateForm(BOOL blPlayStop) 
//BOOL CMsgForm::UpdateForm() 
{
	CFileSpec fs;
	CMainFrame *pFrame = (CMainFrame*)::AfxGetMainWnd();

	/// カレントレコード
	if (theApp.m_lngRdflId <= 0) return FALSE;

	/// 再生中のファイルを停止する(フォーカスが移動するので注意!)
//	PlayStop();
	if (blPlayStop) PlayStop();

	//// プログレスバークリア
	if (m_Prog) m_Prog.SetPos(0);	


	/// 初期設定
	m_lngPlayTime = 0;
	m_strAudioFile.Empty();
	m_strVideoFile.Empty();
	m_Play.EnableWindow(FALSE);
	m_Stop.EnableWindow(FALSE);
	m_Pause.EnableWindow(FALSE);
	m_File.EnableWindow(FALSE);
	m_VFile.EnableWindow(FALSE);
	m_AppPlay.EnableWindow(FALSE);
	m_AppVPlay.EnableWindow(FALSE);
	m_Time.SetWindowText(_T("[ 00:00 ]"));

	/// RDFLテーブル検索
	CTblRdfl tbl(theApp.m_strDBPath);
	if (tbl.SelectRec(theApp.m_lngRdflId) <= 0) {
		return FALSE;
	}

	/// [件名]取得
	m_EditTitle = tbl.strTitle;
	//// [送信者名]取得
	CString strSender;
	if (tbl.strSenderId == _T("0")) {
		//// 不明な発信者(SkypeIn)
		strSender.LoadString(IDS_MSG_DEF);
		m_SenderName.SetWindowText(strSender);
		m_SenderId.SetWindowText(_T(""));
	} else {
		m_SenderName.SetWindowText(tbl.strSenderName);
		m_SenderId.SetWindowText(tbl.strSenderId);
	}
	//// [日時]取得
	_TCHAR strDate[64];
	CnvDateString((LPCTSTR)tbl.dlngSystemNew, strDate);
	m_Date.SetWindowText(strDate);
	/// 音声/ビデオファイル名取得
	int intFormatType = 0;
	CTPsetup tps(theApp.m_strDataFolder);
	tps.SetCallerId(tbl.strSenderId);
	m_strVideoFile = tps.FindRdfVideoFileName(tbl.strRemarks1, tbl.dlngSystemNew, _T("$$"));
	m_strAudioFile = tps.FindRdfWavFileName(tbl.strRemarks1, tbl.dlngSystemNew, _T("$$"));
	if (m_strAudioFile.IsEmpty()) {
		m_strAudioFile = tps.FindRdfMp3FileName(tbl.strRemarks1, tbl.dlngSystemNew, _T("$$"));
		intFormatType = 1;
	}

	CString strBar;
	if (!m_strAudioFile.IsEmpty()) {
	/// 受信音声ファイルがある場合
		CString strTmp;
		//// STatusBar用文字列
		fs.SetFullSpec(m_strAudioFile);
		strBar = fs.GetFileName();
		/// 受信音声ファイルの時間表示
		float fTime = m_pAudio->GetPlaySize(m_strAudioFile);
		if (fTime < 0) {
			_stprintf_s(te.errstr, MAX_ERRSTR, _T("Audio file may be broken:%s"), m_strAudioFile);
			te.ErrorMessage(ERRTYPE_LOGONLY, _T(__FILE__), __LINE__, ERR_TAPUR, te.errstr);
			return FALSE;
		}
		m_lngPlayTime = (fTime > 0) ? (long)fTime : 1;	// 1秒以下は1秒とする
		strTmp.Format(_T("[ %02i:%02i ]"), (m_lngPlayTime/60), (m_lngPlayTime%60));
		m_Time.SetWindowText(strTmp);
		//// 再生・エクスポートボタンを有効
		m_Play.EnableWindow(TRUE);
		m_File.EnableWindow(TRUE);
		m_AppPlay.EnableWindow(TRUE);

	}
	if (!m_strVideoFile.IsEmpty()) {
	/// 受信ビデオファイルがある場合
		//// STatusBar用文字列
		if (strBar.GetLength() > 0) {
			strBar += _T("/avi");
		} else {
			fs.SetFullSpec(m_strVideoFile);
			strBar = fs.GetFileName();
		}
		//// エクスポートボタンを有効
		m_VFile.EnableWindow(TRUE);
		m_AppVPlay.EnableWindow(TRUE);
	}

	/// StatusBarにファイル名、データタイプ表示
	pFrame->SetStatusText(strBar);
	if (tbl.lngRespType == 0) {
		strBar = _T("REC");
		if (tbl.lngClsCode1 == 1 || tbl.lngClsCode1 == 3) {
			strBar += _T("/IN");
		} else if (tbl.lngClsCode1 == 2 || tbl.lngClsCode1 == 4) {
			strBar += _T("/OUT");
		}
	} else {
		strBar = _T("ANSWER");
	}
	pFrame->SetStatusText(strBar, 1);

	/// 再生ファイルが存在しない場合、表示のみで未再生リストを再生済みに変更
	if (m_strAudioFile.IsEmpty() && m_strVideoFile.IsEmpty() && tbl.lngViewFlag != 1) {
		// (???)ChgMsgMark()でテーブル更新すると、テーブルロックが解除されていないため、ここで更新する
		tbl.lngViewFlag = 1;
		tbl.UpdateRec(theApp.m_lngRdflId);
		CMsgList *pfview = (CMsgList *)pFrame->m_pMsgList->GetWnd();
		pfview->ChgMsgMark(FALSE);
	}

	UpdateData(FALSE);	// DDX更新

	return TRUE;
}
예제 #24
0
//
//  機能     : 音声・ビデオ再生
//  
//  機能説明 : 
//  
//  返り値   : BOOL
//  
//  備考     : 
//  
BOOL CMsgForm::Play()
{
	if (_tcsclen(m_strAudioFile) <= 0) return FALSE;

	/// 再生中であれば先に停止
	PlayStop();

	/// ビデオ再生開始
	if (!m_strVideoFile.IsEmpty()) {
		if (!m_pVideo->PlayOpen()) {
			CString str;
			str.LoadString(IDS_MSGBOX64);
			AfxMessageBox(str, MB_OK | MB_APPLMODAL | MB_ICONEXCLAMATION);
			return FALSE;
		}
		if (!m_pVideo->Play(m_strVideoFile)) {
			// Win7+DivXの環境でVideoGrabberが動作しない→エラーでなくWMP再生で代用
			//CString str;
			//str.LoadString(IDS_MSGBOX64);
			//AfxMessageBox(str, MB_OK | MB_APPLMODAL | MB_ICONEXCLAMATION);
			//return FALSE;
			m_pVideo->PlayStop();
			OnBtnAppVPlay();
			goto SECTION_AUDIO_SKIP;
		}
	}
	
	/// 音声再生開始
	m_pAudio->m_PlayFile = m_strAudioFile;
	if (!m_pAudio->PlayOpen()) {
		CString str;
		str.LoadString(IDS_MSGBOX61);
		AfxMessageBox(str, MB_OK | MB_APPLMODAL | MB_ICONEXCLAMATION);
		return FALSE;
	}
	if (!m_pAudio->Play(FALSE)) {
		CString str;
		str.LoadString(IDS_MSGBOX61);
		AfxMessageBox(str, MB_OK | MB_APPLMODAL | MB_ICONEXCLAMATION);
		return FALSE;
	}

	/// 演奏時間管理用タイマー開始
	StartPlayChkTimer(m_lngPlayTime);

	/// 停止ボタンを有効
	m_Stop.EnableWindow(TRUE);
	/// 一時停止ボタンを有効
	m_Pause.EnableWindow(TRUE);
	/// プログレスバー初期化
	if (m_Prog) m_Prog.SetPos(0);	

SECTION_AUDIO_SKIP:

	/// 未再生リストを再生済みに変更
	CMainFrame *pFrame = (CMainFrame*)::AfxGetMainWnd();
	CMsgList *pfview = (CMsgList *)pFrame->m_pMsgList->GetWnd();
	pfview->ChgMsgMark();

	/// 新着メッセージ数をクリア(TOOLTIPの更新のため)
	pFrame->IncNewMsgCnt(0);

	return TRUE;
}
예제 #25
0
파일: tracks.c 프로젝트: onukore/radium
void TRACK_split_into_monophonic_tracks(struct Tracker_Windows *window, struct WBlocks *wblock, struct WTracks *wtrack){
  
  PlayStop(); // This function is too chaotic. Don't bother pausing player.

  vector_t notesvector = {0};
  
  struct Tracks *track = wtrack->track;

  struct Notes *notes = track->notes;
  struct Notes *notes_nexttrack = NULL;

  bool have_made_undo = false;

  if (NOTES_sorted_by_pitch_questionmark(track->notes)==false) {
    ADD_UNDO(Block_CurrPos(window));    
    have_made_undo = true;
    notes = NOTES_sort_by_pitch(notes);
  }
  
  while(notes != NULL){

    struct Notes *notes_root = notes;
    
    while(notes != NULL) {

      struct Notes *next = NextNote(notes);
      if (next==NULL)
        break;

      if (PlaceGreaterThan(&notes->end, &next->l.p)){

        if (have_made_undo==false) {
            have_made_undo=true;
        }
        
        ListRemoveElement3(&notes, &next->l);                           
        ListAddElement3_a(&notes_nexttrack, &next->l);

      } else
        notes = next;
    }

    VECTOR_push_back(&notesvector, notes_root);

    notes = notes_nexttrack;
    notes_nexttrack = NULL;
  }

  if (have_made_undo==false){
    GFX_Message(NULL, "Track is already monophonic");
    return;
  }

  int num_tracks = notesvector.num_elements;

  track->notes = NULL;

  struct WTracks *wtrack_copy = CB_CopyTrack(wblock,wtrack);
  VECTOR_clean(&wtrack_copy->track->fxs);

  InsertTracks(window, wblock, wtrack->l.num+1, num_tracks-1);

  printf("Vector length: %d\n",num_tracks);
  int i;
  for(i=0;i<num_tracks;i++){
    struct Notes *notes = notesvector.elements[i];
    printf("  %d: %d\n", i, ListFindNumElements3(&notes->l));
    while(notes != NULL){
      printf("    %s\n",NotesTexts3[(int)notes->note]);
      notes = NextNote(notes);
    }
    
    struct WTracks *towtrack = ListFindElement1(&wblock->wtracks->l, wtrack->l.num+i);
    
    if (i>0)
      co_CB_PasteTrack(wblock, wtrack_copy, towtrack);

    towtrack->track->notes = notesvector.elements[i];
  }

  window->must_redraw = true;
}
예제 #26
0
파일: gui.c 프로젝트: jeremysalwen/Ceres4
void GUI_GeneralStop(Widget w,XtPointer client, XtPointer call){
  PlayStop();
}
예제 #27
0
파일: api_play.c 프로젝트: onukore/radium
void playStop(void){
  PlayStop();
}
예제 #28
0
파일: disk_load.c 프로젝트: onukore/radium
static bool Load_CurrPos_org(struct Tracker_Windows *window, const wchar_t *filename){
	bool ret = false;

        // So many things happen here, that we should turn off garbage collection while loading.
        //
        // For instance, the instrument widget contains pointers (which are unreachable from the GC) to Patch
        // and PatchData objects. The instrument widget is updated after setting a new root, so it may access
        // that memory while a new song is loaded (since we don't have control over what Qt may do while we
        // access it). Not unlikely to be other similar situations.
        if(0){
          GC_disable();
        }


	PlayStop();

        if(Undo_are_you_shure_questionmark()==false)
          goto exit;

        if(filename==NULL)
          filename=GFX_GetLoadFileName(window,NULL,"Select file to load", NULL, NULL);

	if(filename==NULL) goto exit;

        if (STRING_ends_with(filename,".MMD2") ||
            STRING_ends_with(filename,".MMD3") ||
            STRING_ends_with(filename,".MMD") ||
            STRING_ends_with(filename,".mmd2") ||
            STRING_ends_with(filename,".mmd3") ||
            STRING_ends_with(filename,".mmd")
            )
          {

            mmp2filename=filename;
            ret = Load(STRING_create("new_song.rad"));

          } else {

            OS_set_loading_path(filename);
            {
              ret = Load(filename);
            }
            OS_unset_loading_path();
            
            GFX_SetWindowTitle(root->song->tracker_windows, filename);
            
            GFX_EditorWindowToFront(root->song->tracker_windows);
            
            struct WBlocks *wblock = root->song->tracker_windows->wblock;
            GFX_update_instrument_patch_gui(wblock->wtrack->track->patch);
            
            DrawUpTrackerWindow(root->song->tracker_windows);
            
            fprintf(stderr,"Got here (loading finished)\n");
        }

 exit:

        if(0){
          GC_enable();
        }

	if(mmp2filename!=NULL) {
          LoadMMP2(root->song->tracker_windows, mmp2filename);
          mmp2filename=NULL;
        }

        if (ret)
          ResetUndo();
        
        return ret;
}