Beispiel #1
0
 TimerEvent Timer::QueueCallback(const QSharedPointer<TimerCallback> &callback,
     int due_time, int period)
 {
   TimerEvent te(callback, due_time, period);
   QueueEvent(te);
   return te;
 }
Beispiel #2
0
HRESULT PpboxStream::Start(const PROPVARIANT& varStart)
{
    SourceLock lock(m_pSource);

    HRESULT hr = S_OK;

    hr = CheckShutdown();

    // Queue the stream-started event.
    if (SUCCEEDED(hr))
    {
        hr = QueueEvent(MEStreamStarted, GUID_NULL, S_OK, &varStart);
    }

    if (SUCCEEDED(hr))
    {
        m_state = STATE_STARTED;
    }

    // If we are restarting from paused, there may be
    // queue sample requests. Dispatch them now.
    if (SUCCEEDED(hr))
    {
        hr = DispatchSamples();
    }
    return hr;
}
HRESULT MPEG1Stream::Start(const PROPVARIANT& varStart)
{
    SourceLock lock(m_pSource);

    HRESULT hr = S_OK;

    CHECK_HR(hr = CheckShutdown());

    // Queue the stream-started event.
    CHECK_HR(hr = QueueEvent(
        MEStreamStarted,
        GUID_NULL,
        S_OK,
        &varStart
        ));

    m_state = STATE_STARTED;

    // If we are restarting from paused, there may be 
    // queue sample requests. Dispatch them now.
    CHECK_HR(hr = DispatchSamples());

done:
    return hr;
}
Beispiel #4
0
	void Viewer::AddNotification(const CacheNotification& notification) {
		std::unique_lock<std::mutex> l(m_mutexNotification);
		m_cacheNotifications.push_back(notification);
		l.unlock();

		QueueEvent(new wxCommandEvent(ImageLoadEvent));
	}
Beispiel #5
0
	void Viewer::AddNotification(const IO::FileEvent& notification) {
		std::unique_lock<std::mutex> l(m_mutexNotification);
		m_folderNotifications.push_back(notification);
		l.unlock();

		QueueEvent(new wxCommandEvent(FolderEvent));
	}
Beispiel #6
0
void CAsyncRequestQueue::TriggerProcessing()
{
	if (m_inside_request)
		return;

	QueueEvent(new wxCommandEvent(fzEVT_PROCESSASYNCREQUESTQUEUE));
}
Beispiel #7
0
void PyloadDataStore::setQueuePackages(const std::vector<PackageData>& queuePackages) {
    boost::unique_lock<boost::shared_mutex> lock(m_mutex);
    m_queuePackages = queuePackages;
    lock.unlock();
    wxCommandEvent* event = new wxCommandEvent(wxEVT_NETWORK, ID_QUEUE_PACKAGES);
    QueueEvent(event);
}
Beispiel #8
0
void wxMediaBackendCommonBase::NotifyMovieLoaded()
{
    NotifyMovieSizeChanged();

    // notify about movie being fully loaded
    QueueEvent(wxEVT_MEDIA_LOADED);
}
void CContextControl::OnTabClosing(wxAuiNotebookEvent& event)
{
	// Need to defer event, wxAUI would write to free'd memory
	// if we'd actually delete tab and potenially the notebook with it
	QueueEvent(new wxCommandEvent(fzEVT_TAB_CLOSING_DEFERRED, event.GetSelection()));

	event.Veto();
}
void CMPEG1Stream::Pause()
{
    ThrowIfError(CheckShutdown());

    m_state = STATE_PAUSED;

    ThrowIfError(QueueEvent(MEStreamPaused, GUID_NULL, S_OK, nullptr));
}
Beispiel #11
0
void CContextControl::OnTabContextClose(wxCommandEvent& event)
{
	if (m_right_clicked_tab == -1)
		return;

	// Need to defer event, wxAUI would write to free'd memory
	// if we'd actually delete tab and potenially the notebook with it
	QueueEvent(new wxCommandEvent(fzEVT_TAB_CLOSING_DEFERRED, m_right_clicked_tab));
}
Beispiel #12
0
void
Clock::SetClockState (ClockState state)
{
#if CLOCK_DEBUG
	const char *states[] = { "Active", "Filling", "Stopped" };
	printf ("Setting clock %p state to %s\n", this, states[state]);
#endif
	this->state = state;
	QueueEvent (CURRENT_STATE_INVALIDATED);
}
Beispiel #13
0
void ProgressIndicator::mouseDown(wxMouseEvent &event)
{
	this->value = (float)event.GetPosition().x / (float)width;
	// Repaint directly - gives a nicer feedback to the user
	paintNow();

	wxCommandEvent pressEvent = wxCommandEvent(PI_SCROLL_CHANGED);
	
	QueueEvent(pressEvent.Clone());
}
bool	CMultiXWSStream::CallServiceNoWait(CMultiXAppMsg	&Msg)
{
	if(!IsRunning())
		if(!Start())
			return	false;
	CMultiXWSStreamEvent	*Ev	=	new	CMultiXWSStreamEvent(CMultiXWSStreamEvent::CallServiceFromMessage);
	Msg.Keep();
	Ev->m_MsgID	=	Msg.ID();
	QueueEvent(Ev);
	return	true;
}
void CMPEG1Stream::Stop()
{
    ThrowIfError(CheckShutdown());

    m_Requests.Clear();
    m_Samples.Clear();

    m_state = STATE_STOPPED;
       
    ThrowIfError(QueueEvent(MEStreamStopped, GUID_NULL, S_OK, nullptr));
}
Beispiel #16
0
void MainFrame::myMessageBoxDelayed(const wxString &message,
	const wxString &caption, int style, wxWindow *parent, int x, int y)
{
	if (wxThread::IsMain())
		wxMessageBox(message, caption, style, parent, x, y);

	myMessageBoxEvent *event = new myMessageBoxEvent(
		MY_MESSAGEBOX, message, caption, style, parent, x, y );

	QueueEvent(event);
}
Beispiel #17
0
void gxSubject::Fire( gxEvent &aEvent, gxCallback aCallback )
{    
    if ( mFiringMode == on )
    {
        // If a specific callback was requested then only fire that one,
        // otherwise Fire() will fire all callbacks.
        aCallback.empty() ? aEvent.Fire() : aEvent.Fire( aCallback );
    } else if ( mFiringMode == queue ) {
        QueueEvent( aEvent );
    } // Otherwise FiringMode is off
}
Beispiel #18
0
void SjMyMusicConfigPage::OnListKeyDown(wxListEvent& event)
{
	switch( event.GetKeyCode() )
	{
		case WXK_DELETE:
		case WXK_BACK:
		{
			QueueEvent(new wxCommandEvent(wxEVT_COMMAND_MENU_SELECTED, IDC_IDXDELSOURCE));
		}
		break;
	}
}
Beispiel #19
0
	void Module::DebugString(const std::string& name, const std::string& value) {
		pimpl->DbgStringEvent->Data() = std::pair<std::string, std::string>(name, value);

		if (pimpl->useEventQueue)
		{
			QueueEvent(*pimpl->DbgStringEvent, true);
		} else
		{
			// XXX: This is hardcoded!!
			if (pimpl->Name == "EventCore") Core::EvtCore->PostEventToQueue(1, *pimpl->DbgStringEvent);
		}
	}
Beispiel #20
0
HRESULT FlvStream::Start(UINT64 nanosec, BOOL isseek) {
  SourceLock lock(source);
  _prop_variant_t starttime(nanosec);
  auto hr = CheckShutdown();
  if (ok(hr) && isseek) {
    samples.clear();// abandon previsou cached samples, but keep tokens
    QueueEvent(MEStreamSeeked, GUID_NULL, hr, &starttime);
  } else if (ok(hr)) {// Queue the stream-started event.
    hr = QueueEvent(MEStreamStarted, GUID_NULL, S_OK, &starttime);
  }

  if (ok(hr)) {
    m_state = SourceState::STATE_STARTED;
  }

  // If we are restarting from paused, there may be
  // queue sample requests. Dispatch them now.
  if (ok(hr)) {
    hr = DispatchSamples();
  }
  return hr;
}
Beispiel #21
0
void CAsyncRequestQueue::OnProcessQueue(wxCommandEvent &)
{
	if (m_inside_request)
		return;

	m_inside_request = true;
	bool success = ProcessNextRequest();
	m_inside_request = false;

	if (success && !m_requestList.empty()) {
		QueueEvent(new wxCommandEvent(fzEVT_PROCESSASYNCREQUESTQUEUE));
	}
}
void NetworkManager::Connect(Connection target) {
    //Logger::Get().Info("New Connection : " + QString::fromStdString(target.GetIPAddress().ToString()));
    // remember target
    uint16_t id = mConnectionsManager.AddConnection(&target);
    // Connection* c = mConnectionsManager.GetConnection(id);

    // send handshake
    std::shared_ptr<HandshakeEvent> h(new HandshakeEvent());
    h->ClearRecipients();
    h->AddRecipient(id);
    QueueEvent(h);

}
void CMPEG1Stream::Start(const PROPVARIANT &varStart)
{

    ThrowIfError(CheckShutdown());

    // Queue the stream-started event.
    ThrowIfError(QueueEvent(MEStreamStarted, GUID_NULL, S_OK, &varStart));

    m_state = STATE_STARTED;

    // If we are restarting from paused, there may be
    // queue sample requests. Dispatch them now.
    DispatchSamples();
}
HRESULT WavStream::DeliverQueuedSamples()
{
    HRESULT hr = S_OK;
    IMFSample *pSample = NULL;

    EnterCriticalSection(&m_critSec);

    // If we already reached the end of the stream, send the MEEndStream 
    // event again.
    if (m_EOS)
    {
        hr = QueueEvent(MEEndOfStream, GUID_NULL, S_OK, NULL);
    }

    if (SUCCEEDED(hr))
    {   
        // Deliver any queued samples. 
        while (!m_sampleQueue.IsEmpty())
        {
            hr = m_sampleQueue.Dequeue(&pSample);
            if (FAILED(hr))
            {
                break;
            }

            hr = DeliverSample(pSample);
            if (FAILED(hr))
            {
                break;
            }

            SafeRelease(&pSample);
        }
    }

    LeaveCriticalSection(&m_critSec);

    // If we reached the end of the stream, send the end-of-presentation event from
    // the media source.
    if (SUCCEEDED(hr))
    {   
        if (m_EOS)
        {
            hr = m_pSource->QueueEvent(MEEndOfPresentation, GUID_NULL, S_OK, NULL);
        }
    }

    SafeRelease(&pSample);
    return hr;
}
Beispiel #25
0
HRESULT FlvStream::Pause()
{
  SourceLock lock(source);

  auto hr = CheckShutdown();

  if (SUCCEEDED(hr))
  {
    m_state = SourceState::STATE_PAUSED;

    hr = QueueEvent(MEStreamPaused, GUID_NULL, S_OK, NULL);
  }

  return hr;
}
Beispiel #26
0
bool CAsyncRequestQueue::AddRequest(CFileZillaEngine *pEngine, std::unique_ptr<CAsyncRequestNotification> && pNotification)
{
	ClearPending(pEngine);

	if (ProcessDefaults(pEngine, pNotification))
		return false;

	m_requestList.emplace_back(pEngine, std::move(pNotification));

	if (m_requestList.size() == 1) {
		QueueEvent(new wxCommandEvent(fzEVT_PROCESSASYNCREQUESTQUEUE));
	}

	return true;
}
HRESULT MPEG1Stream::Pause()
{
    SourceLock lock(m_pSource);

    HRESULT hr = S_OK;

    CHECK_HR(hr = CheckShutdown());

    m_state = STATE_PAUSED;

    CHECK_HR(hr = QueueEvent(MEStreamPaused, GUID_NULL, S_OK, NULL));

done:
    return hr;
}
HRESULT WavStream::CheckEndOfStream()
{
    HRESULT hr = S_OK;

    if (m_pRiff->BytesRemainingInChunk() < m_pRiff->Format()->nBlockAlign)
    {
        // The remaining data is smaller than the audio block size. (In theory there shouldn't be
        // partial bits of data at the end, so we should reach an even zero bytes, but the file
        // might not be authored correctly.)
        m_EOS = TRUE;

        // Send the end-of-stream event,
        hr = QueueEvent(MEEndOfStream, GUID_NULL, S_OK, NULL);
    }
    return hr; 
}
Beispiel #29
0
HRESULT PpboxStream::Pause()
{
    SourceLock lock(m_pSource);

    HRESULT hr = S_OK;

    hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        m_state = STATE_PAUSED;

        hr = QueueEvent(MEStreamPaused, GUID_NULL, S_OK, NULL);
    }

    return hr;
}
Beispiel #30
0
HRESULT FlvStream::Stop()
{
  SourceLock lock(source);

  auto hr = CheckShutdown();

  if (SUCCEEDED(hr))
  {
    requests.clear();
    samples.clear();

    m_state = SourceState::STATE_STOPPED;

    hr = QueueEvent(MEStreamStopped, GUID_NULL, S_OK, NULL);
  }

  return hr;
}