#include "StdAfx.h" #include "cwxSoundEventPanel.h" #include "ToolData.h" #include "RTCutSceneMakerFrame.h" #include "cwxPropertyPanel.h" #include "cwxEventTimeLinePanel.h" BEGIN_EVENT_TABLE( cwxSoundEventPanel, wxPanel ) EVT_LIST_ITEM_SELECTED( LIST_CAMERA_ID, cwxSoundEventPanel::OnSelChangeCameraList ) END_EVENT_TABLE() cwxSoundEventPanel::cwxSoundEventPanel( wxWindow* pParent, wxWindowID id /* = -1 */ ) : CEventPanel( pParent, id ) { CEventPanel::_Initialize( LIST_CAMERA_ID, EventInfo::SOUND_1 ); } cwxSoundEventPanel::~cwxSoundEventPanel(void) { } void cwxSoundEventPanel::_UpdateEventList( void ) { m_pListView->ClearAll(); _InitListViewColumn(); // Ãß°¡ÀûÀ¸·Î SOUND_8 ¹ø±îÁö ¸®½ºÆ®¿¡ ³Ö´Â´Ù. // »ç¿îµå À̺¥Æ® Á¤º¸ ±Ü¾î¿È. for( int iEventType = EventInfo::SOUND_1; iEventType <= EventInfo::SOUND_8; ++iEventType ) { int iNumEventInfo = TOOL_DATA.GetThisTypesEventNum( iEventType ); for( int iEvent = 0; iEvent < iNumEventInfo; ++iEvent ) { const EventInfo* pEventInfo = TOOL_DATA.GetEventInfoByIndex( iEventType, iEvent ); wxCSConv MBConv( wxFONTENCODING_CP949 ); wxChar caWBuf[ 256 ]; ZeroMemory( caWBuf, sizeof(caWBuf) ); MBConv.MB2WC( caWBuf, pEventInfo->strEventName.c_str(), 256 ); long iTemp = m_pListView->InsertItem( iEvent, caWBuf ); m_pListView->SetItemData( iTemp, iEvent ); wxSnprintf( caWBuf, 256, wxT("%dms"), DWORD(pEventInfo->fStartTime*10.0f) ); m_pListView->SetItem( iEvent, 1, caWBuf ); wxSnprintf( caWBuf, 256, wxT("%d"), pEventInfo->iID ); m_pListView->SetItem( iEvent, 2, caWBuf ); } } } // TODO: ¸®½ºÆ®¿¡¼­ »ç¿îµå À̺¥Æ®°¡ ¼±ÅõǸé Propertyµµ »ç¿îµå·Î ¹Ù²î¾î¾ß ÇÑ´Ù. ±×¸®°í ¸¶¿ì½º·Î ÆíÁý°¡´ÉÇÑ »óŰ¡ µÈ´Ù. void cwxSoundEventPanel::OnSelChangeCameraList( wxListEvent& ListEvent ) { // ¼ÂÆÃµÈ °÷À¸·Î À̺¥Æ® ŸÀÓ ¶óÀο¡¼­ ¼±ÅÃÇØ ÁÜ. int iSelected = m_pListView->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ); if( wxNOT_FOUND != iSelected ) { // ¸®½ºÆ® ºäÀÇ À妽º´Â µ¥ÀÌÅÍ »óÀÇ À妽º¿Í ÀÏÄ¡ÇÑ´Ù. wxListItem Item; Item.SetId( iSelected ); Item.SetColumn( 2 ); Item.SetMask( wxLIST_MASK_TEXT ); m_pListView->GetItem( Item ); //const EventInfo* pSelectedEventInfo = TOOL_DATA.GetEventInfoByIndex( EventInfo::SOUND_1, iSelected ); long ID = 0; Item.GetText().ToLong( &ID ); const EventInfo* pSelectedEventInfo = TOOL_DATA.GetEventInfoByID( ID ); if( pSelectedEventInfo ) { // À̺¥Æ® ŸÀÓ¶óÀο¡°Ô ¼¿·º¼Ç ½ÃÅ´ cwxTLObjectSelectEvent SelectEvent( wxEVT_TIMELINE_OBJECT_SELECT, -1, wxString(wxT("List Select")), pSelectedEventInfo->iID, pSelectedEventInfo->iType+3, 0 ); // Åø¿¡¼­ ¾²´Â À̺¥Æ® ŸÀÔÀÌ »ç¿îµåº¸´Ù À§¿¡ 3°³°¡ ´õ ÀÖÀ½. cwxEventTimeLinePanel* pEventTimeLinePanel = TOOL_DATA.GetEventTLPanel(); pEventTimeLinePanel->OnTLObjectSelect( SelectEvent ); // ¼Ó¼ºÃ¢ µîµî ÀÚµ¿À¸·Î ¹Ù²ñ pEventTimeLinePanel->SelectObject( pSelectedEventInfo->iID, DWORD(pSelectedEventInfo->fStartTime*10.0f) ); } } }