예제 #1
0
void EventBrowser::Find(bool forward)
{
  if(ui->findEvent->text().isEmpty())
    return;

  uint32_t curEID = m_Core->CurEvent();
  if(!ui->events->selectedItems().isEmpty())
    curEID = ui->events->selectedItems()[0]->data(COL_EID, Qt::UserRole).toUInt();

  int eid = FindEvent(ui->findEvent->text(), curEID, forward);
  if(eid >= 0)
  {
    SelectEvent((uint32_t)eid);
    ui->findEvent->setStyleSheet("");
  }
  else    // if(WrapSearch)
  {
    eid = FindEvent(ui->findEvent->text(), forward ? 0 : ~0U, forward);
    if(eid >= 0)
    {
      SelectEvent((uint32_t)eid);
      ui->findEvent->setStyleSheet("");
    }
    else
    {
      ui->findEvent->setStyleSheet("QLineEdit{background-color:#ff0000;}");
    }
  }
}
예제 #2
0
TKeyResponse CPlaylistMgr::KeyEventL(const TKeyEvent& aKeyEvent,
                                     TEventCode aType, EAnimationEffectType& aEffect)
{
    TInt update;
    switch (aType)
    {
    case EEventKey:
        switch (aKeyEvent.iScanCode)
        {
        case EStdKeyUpArrow:
            update = iControlMgr->Update(KCustomControlDirectionUp);
            if (update == EKeyWasConsumed)
            {
                aEffect = KAnimationEffectNone;
            }
            return EKeyWasConsumed;
        case EStdKeyDownArrow:
            update = iControlMgr->Update(KCustomControlDirectionDown);
            if (update == EKeyWasConsumed)
            {
                aEffect = KAnimationEffectNone;
            }
            return EKeyWasConsumed;
        case EStdKeyDevice3:
            SelectEvent();
            aEffect = KAnimationEffectSwap;
            return EKeyWasConsumed;
        }
        break;
    }
    return EKeyWasNotConsumed;
}
예제 #3
0
파일: NET.cpp 프로젝트: slawer/krs_kal
void NET_Server::StartListen(WORD port)
{
//	MutexWrap socket_access(m_socket_mutex);
	LOG_V0_AddMessage(LOG_V0_DEBUG_MESSAGE, GetName() + (TXT("::StartListen(%d)") << port));

	if (m_listening)
		PrivateStopListen();

	if (!m_created)
		Create();
	if (!m_created)
		return;

	if (m_listening_port != port)
	{
		sockaddr_in local_addr;
		local_addr.sin_family = AF_INET;
		local_addr.sin_port = htons(port);
		local_addr.sin_addr.s_addr = 0;
		OP( bind(m_socket, (sockaddr *)&local_addr, sizeof(local_addr)), "NET_Server::StartListen, bind" );
		m_listening_port = port;
	}
	OP( listen(m_socket, 0x100), "NET_Server::StartListen, listen" );
	SelectEvent(m_wait_thread.Event(WT_ACCEPTED), FD_ACCEPT);
	m_listening = true;
}
예제 #4
0
파일: NET.cpp 프로젝트: slawer/krs_kal
void NET_Server::PrivateStopListen()
{
	if (!m_created || !m_listening)
		return;

	LOG_V0_AddMessage(LOG_V0_DEBUG_MESSAGE, GetName() + "::PrivateStopListen() started");

	CHECK(m_socket != INVALID_SOCKET);
	SelectEvent(m_wait_thread.Event(WT_ACCEPTED), 0);
	{
		MutexWrap connections_access(m_connections_mutex);
		while (!m_connections.empty())
		{
			NET_Connection* connection = m_connections.back();
			connection->m_read_thread.Stop();
			connection->m_write_thread.Stop();
			connection->m_server = NULL;
			m_connections.pop_back();
			connection->PrivateClose();

			OnConnectionClosed(connection);
			delete connection;
		}
	}
	m_wait_thread.Stop();
	OP2( shutdown(m_socket, SD_BOTH), m_last_error != WSAENOTCONN, "NET_Server::PrivateStopListen, shutdown" );
	OP( closesocket(m_socket), "NET_Server::PrivateStopListen, closesocket" );
	m_socket = INVALID_SOCKET;
	m_listening = false;
	m_listening_port = -1;
	m_created = false;

	LOG_V0_AddMessage(LOG_V0_DEBUG_MESSAGE, GetName() + "::PrivateStopListen() finished");
}
예제 #5
0
void blSignalEventTable::SelectAll()
{
	EventMapType::iterator it;
	for ( it = m_EventMap.begin() ; it != m_EventMap.end(); it++ )
	{
		SelectEvent( it->second.m_Type, true );
	}
}
예제 #6
0
AmSelectionsI* AmTrackDataView::SelectFirstEvent(const AmTrack* track)
{
	ArpASSERT(track);
	AmPhraseEvent*	container = NULL;
	AmEvent*		event = FirstEvent(track, &container);
	if (event) return SelectEvent(event, container);
	else return NULL;
}
예제 #7
0
void EventBrowser::on_jumpToEID_returnPressed()
{
  bool ok = false;
  uint eid = ui->jumpToEID->text().toUInt(&ok);
  if(ok)
  {
    SelectEvent(eid);
  }
}
예제 #8
0
void blSignalEventTable::SelectGroup( int index, bool select /*= true */ )
{
	std::vector<blSignalEvent> eventTable;
	eventTable = GetGroupEvents( index );
	for ( size_t i = 0 ; i < eventTable.size() ; i++ )
	{
		SelectEvent( eventTable[ i ].m_Type, select );
	}
}
예제 #9
0
void AmTrackDataView::SelectRightEvent()
{
#if 0
	ArpASSERT(mTarget);
	AmSelectionsI*		newSelections = NULL;
	// READ SONG BLOCK
	#ifdef AM_TRACE_LOCKS
	printf("AmTrackDataView::SelectRightEvent() read lock\n"); fflush(stdout);
	#endif
	const AmSong*	song = mSongRef.ReadLock();
	const AmTrack*	track = song ? song->Track(mTrackWinProps.OrderedTrackAt(0)) : NULL;
	if (track) {
		AmSelectionsI*	selections = mTrackWinProps.Selections();
		/* If there are no selections, select the first event
		 * starting on or after the left edge of the window.
		 */
		if (!selections || selections->CountEvents() < 1) {
			newSelections = SelectFirstEvent(track);
		/* If there are already events, select the next event
		 * over from the end of the last selected event.  And if
		 * that event isn't visible, select the first visible event.
		 */
		} else {
			/* Find the event to move right from.
			 */
			AmEvent*		event = 0;
			AmPhraseEvent*	container = 0;
			AmEvent*		iteratingEvent;
			AmPhraseEvent*	iteratingContainer;
			for (uint32 k = 0; selections->EventAt(k, &iteratingContainer, &iteratingEvent) == B_OK; k++) {
				if (!event || (iteratingContainer->EventRange(iteratingEvent).start > container->EventRange(event).start) ) {
					event = iteratingEvent;
					container = iteratingContainer;
				}
			}
			if (!event) newSelections = SelectFirstEvent(track);
			else {
				/* Select the next event over.  This has a lot of problems,
				 * like not dealing with operlapping phrases.
				 */
				if (NextRightEvent(track, event, container, &iteratingEvent, &iteratingContainer) == B_OK)
					newSelections = SelectEvent(iteratingEvent, iteratingContainer);
				else newSelections = SelectFirstEvent(track);
			}
		}

	}
	mSongRef.ReadUnlock(song);
	// END READ SONG BLOCK
	if (newSelections) mTrackWinProps.SetSelections(newSelections);
#endif
}
예제 #10
0
파일: NET.cpp 프로젝트: slawer/krs_kal
void NET_Client::StartConnect(CString to_host, WORD to_port)
{
	LOG_V0_AddMessage(LOG_V0_DEBUG_MESSAGE, GetName() + (TXT("::StartConnect(%s, %d)") << to_host << to_port));

	if (m_connecting || m_connected)
		PrivateStopConnect();

	if (!m_created)
		Create();

	m_connecting = true;
	m_to_host = to_host;
	m_to_port = to_port;
	if (!CalculateSocketAddress())
	{
		m_connecting = false;
		return;
	}
	SelectEvent(m_wait_thread.Event(WT_CONNECTED), FD_CONNECT);
	WSASetEvent(m_wait_thread.Event(WT_START_CONNECT));
}
예제 #11
0
void EventBrowser::OnEventSelected(uint32_t eventID)
{
  SelectEvent(eventID);
}
예제 #12
0
void EventBrowser::OnEventSelected(uint32_t frameID, uint32_t eventID)
{
	SelectEvent(frameID, eventID);
}