Exemplo n.º 1
0
NetherSwap::NetherSwap(QWidget *parent)
    : QMainWindow(parent),
      settings_(this),
      is_dragging_(false),
      is_second_instance_(false),
      tray_icon_(QIcon(":/NetherSwap/Resources/icons/netherswap-tray.ico"), this) {
  qRegisterMetaType<GameStatus>("GameStatus");
  qRegisterMetaType<HotkeySequence>("HotkeySequence");

  QLocalSocket single_instance_checker;
  single_instance_checker.connectToServer("netherswap_instance_check");
  if(single_instance_checker.waitForConnected(250)) {
    // connected means a server is running elsewhere, exit this one
    single_instance_checker.abort();
    QTimer::singleShot(0, this, SLOT(close()));
    is_second_instance_ = true;
    return;
  }
  
  single_instance_checker.abort();
  single_instance_server_ = new QLocalServer(this);
  // running a second instance should bring up the first
  connect(single_instance_server_, SIGNAL(newConnection()), this, SLOT(Unminimize()));
  single_instance_server_->listen("netherswap_instance_check");

  QThread* monitor_thread = new QThread();
  GameMonitor* monitor = new GameMonitor("DOTA 2", "Valve001");
  monitor->moveToThread(monitor_thread);
  connect(monitor_thread, SIGNAL(started()), monitor, SLOT(Start()));
  connect(monitor_thread, SIGNAL(finished()), monitor, SLOT(deleteLater()));
  connect(monitor_thread, SIGNAL(finished()), monitor_thread, SLOT(deleteLater()));
  connect(this, SIGNAL(destroyed()), monitor_thread, SLOT(quit()));

  connect(monitor, SIGNAL(StatusChanged(GameStatus)), this, SLOT(StatusChanged(GameStatus)));

  ui.setupUi(this);
  ReadSettings();
  connect(ui.in_game_hotkey_btn, SIGNAL(HotkeySet(const HotkeySequence&)), this, 
      SLOT(InGameHotkeyChanged(const HotkeySequence&)));
  connect(ui.out_of_game_hotkey_btn, SIGNAL(HotkeySet(const HotkeySequence&)), this, 
      SLOT(OutOfGameHotkeyChanged(const HotkeySequence&)));

  setWindowFlags(Qt::FramelessWindowHint);
  connect(ui.minimize_btn, SIGNAL(clicked()), this, SLOT(hide()));
  connect(ui.close_btn, SIGNAL(clicked()), this, SLOT(close()));

  tray_icon_.show();
  connect(&tray_icon_, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this,
      SLOT(IconActivated(QSystemTrayIcon::ActivationReason)));

  ui.version_label->setText(QString("v%1.%2").arg(NETHERSWAP_VERSION_MAJOR)
      .arg(NETHERSWAP_VERSION_MINOR));

  connect(monitor, SIGNAL(StatusMessage(const QString&)), ui.status_label, 
    SLOT(setText(const QString&)));

  monitor_thread->start();
}
 void ScanProgress::SetStatus(int Status) {
     if (this->Status == Status) return;
     if (Status < 0) this->Status = 0;
     else if (Status > 100) this->Status = 100;
     else this->Status = Status;
     StatusChanged();
 }
Exemplo n.º 3
0
MusicPlayer::MusicPlayer(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MusicPlayer)
{
    ui->setupUi(this);

    Player = new QMediaPlayer(this);
    PlayList = new QMediaPlaylist;

    connect(Player,SIGNAL(positionChanged(qint64)),this,SLOT(PositionChanged(qint64)));
    connect(ui->LengthSlider,SIGNAL(sliderMoved(int)),this,SLOT(SetPosition(int)));
    connect(Player,SIGNAL(durationChanged(qint64)),this,SLOT(DurationChanged(qint64)));
    connect(Player,SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),this,SLOT(StatusChanged(QMediaPlayer::MediaStatus)));
    connect(ui->VolumeSlider,SIGNAL(valueChanged(int)),this,SLOT(SetVolume(int)));

    connect(ui->button_start,SIGNAL(released()),this,SLOT(Play()));
    connect(ui->button_stop,SIGNAL(released()),this,SLOT(Stop()));

    connect(ui->button_next,SIGNAL(released()),this,SLOT(Next()));
    connect(ui->button_prev,SIGNAL(released()),this,SLOT(Prev()));

    connect(ui->button_add,SIGNAL(released()),this,SLOT(Add()));
    connect(ui->button_remove,SIGNAL(released()),this,SLOT(Remove()));

    connect(ui->playlist,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(PlaySelected(QModelIndex)));

    connect(ui->actionSave,SIGNAL(triggered()),this,SLOT(SavePlayList()));
    connect(ui->actionLoad,SIGNAL(triggered()),this,SLOT(OpenPlayList()));

    Player->setPlaylist(PlayList);

    ui->VolumeSlider->setRange(0,100);
    ui->VolumeSlider->setValue(100);
}
Exemplo n.º 4
0
SysTrayIconWrapper::SysTrayIconWrapper(const MainView& view, const PlayListManager& playlists):
    QObject(),
    mPlaylists(playlists),
    mSystemTrayIcon(QIcon(":/nocturn.png")),
    mSystemTrayMenu(),
    mPlayAction(QIcon::fromTheme("media-playback-start"), tr("Play"), nullptr),
    mStopAction(QIcon::fromTheme("media-playback-stop"), tr("Stop"), nullptr),
    mStatus(SharedTypes::StoppedState)
{
    connect(SettingsManager::getSettingsManager(), SIGNAL(ConfigurationUpdated()), this, SLOT(rebuildMenu()));
    connect(SettingsManager::getSettingsManager(), SIGNAL(ConfigurationUpdated()), this, SLOT(updateTrayVisibility()));
    connect(&mSystemTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), &view, SLOT(toggleWindowVisiblity(QSystemTrayIcon::ActivationReason)));

    connect(&mPlaylists, SIGNAL(CurrentSongChanged(const QString&)), this, SLOT(rebuildMenu()));
    connect(&mPlaylists, SIGNAL(ActivePlayListChanged()), this, SLOT(rebuildMenu()));
    connect(&mPlaylists, SIGNAL(TrackListChanged()), this, SLOT(rebuildMenu()));

    connect(&mPlayAction, SIGNAL(triggered(bool)), MainControler::getMainControler(), SLOT(startPlayback()));
    connect(&mStopAction, SIGNAL(triggered(bool)), MainControler::getMainControler(), SLOT(stopPlayback()));

    connect(MainControler::getMainControler(), SIGNAL(StatusChanged(SharedTypes::PlaybackState, SharedTypes::PlaybackState)),
            this, SLOT(changeStatus(SharedTypes::PlaybackState, SharedTypes::PlaybackState)));

    updateTrayVisibility();
    rebuildMenu();
    mSystemTrayIcon.setContextMenu(&mSystemTrayMenu);
}
void GPSPositionSensor::emitNotifications()
{
            //if (data.Latitude != oldData.Latitude)
            emit LatitudeChanged(data.Latitude);
        //if (data.Longitude != oldData.Longitude)
            emit LongitudeChanged(data.Longitude);
        //if (data.Altitude != oldData.Altitude)
            emit AltitudeChanged(data.Altitude);
        //if (data.GeoidSeparation != oldData.GeoidSeparation)
            emit GeoidSeparationChanged(data.GeoidSeparation);
        //if (data.Heading != oldData.Heading)
            emit HeadingChanged(data.Heading);
        //if (data.Groundspeed != oldData.Groundspeed)
            emit GroundspeedChanged(data.Groundspeed);
        //if (data.PDOP != oldData.PDOP)
            emit PDOPChanged(data.PDOP);
        //if (data.HDOP != oldData.HDOP)
            emit HDOPChanged(data.HDOP);
        //if (data.VDOP != oldData.VDOP)
            emit VDOPChanged(data.VDOP);
        //if (data.Status != oldData.Status)
            emit StatusChanged(data.Status);
        //if (data.Satellites != oldData.Satellites)
            emit SatellitesChanged(data.Satellites);

}
void GPSPositionSensor::setStatus(quint8 value)
{
   mutex->lock();
   bool changed = data.Status != value;
   data.Status = value;
   mutex->unlock();
   if (changed) emit StatusChanged(value);
}
Exemplo n.º 7
0
    void EngineChannel::SetMute(int state) throw (Exception) {
        if (p->iMute == state) return;
        if (state < -1 || state > 1)
            throw Exception("Invalid Mute state: " + ToString(state));

        p->iMute = state;

        StatusChanged(true);
    }
Exemplo n.º 8
0
    void EngineChannel::SetMidiInstrumentMap(int MidiMap) throw (Exception) {
        if (p->iMidiInstrumentMap == MidiMap) return;

        // check if given map actually exists in the MIDI instrument mapper
        std::vector<int> maps = MidiInstrumentMapper::Maps();
        if (find(maps.begin(), maps.end(), MidiMap) == maps.end())
            throw Exception("MIDI instrument map doesn't exist");
        p->iMidiInstrumentMap = MidiMap; // assign the new map ID
        StatusChanged(true);
    }
Exemplo n.º 9
0
    void VoiceSession::CreateFarsightChannel()
    {
        try
        {
            // todo: for linux use "autoaudiosrc" for audio_src_name
            //       CURRENT IMPLEMENTATION WORKS ONLY ON WINDOWS
            farsight_channel_ = new FarsightChannel(tp_channel_, "dshowaudiosrc", "autovideosrc", "autovideosink");
            if ( !farsight_channel_->IsAudioSupported() )
            {
                SAFE_DELETE(farsight_channel_);
                QString message = QString("Cannot initialize audio features.");
                reason_ = message;
                LogError(message.toStdString());
                state_ = STATE_ERROR;
                emit StateChanged(state_);
                return;
            }
        }
        catch(Exception &e) 
        {
            QString message = QString("Cannot create FarsightChannel object - ").append(e.what());
            reason_ = message;
            LogError(message.toStdString());
            state_ = STATE_ERROR;
            emit StateChanged(state_);
            return;
        }

        connect( farsight_channel_, SIGNAL(AudioDataAvailable(int)), SLOT( OnFarsightAudioDataAvailable(int ) ), Qt::QueuedConnection );
        connect( farsight_channel_, SIGNAL(AudioBufferOverflow(int)), SLOT( OnFarsightAudioBufferOverflow(int ) ), Qt::QueuedConnection );

        connect(tp_channel_->becomeReady(Tp::StreamedMediaChannel::FeatureStreams),
             SIGNAL( finished(Tp::PendingOperation*) ),
             SLOT( OnStreamFeatureReady(Tp::PendingOperation*) ));

        connect(farsight_channel_,
            SIGNAL(StatusChanged(TelepathyIM::FarsightChannel::Status)),
            SLOT(OnFarsightChannelStatusChanged(TelepathyIM::FarsightChannel::Status)),  Qt::QueuedConnection);

        connect(farsight_channel_,
            SIGNAL( AudioStreamReceived() ),
            SLOT( OnFarsightChannelAudioStreamReceived() ),  Qt::QueuedConnection);

        connect(farsight_channel_,
            SIGNAL( VideoStreamReceived() ),
            SLOT( OnFarsightChannelVideoStreamReceived() ), Qt::QueuedConnection);
    }
Exemplo n.º 10
0
QSMP_BEGIN

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

Player::Player(boost::function<Media ()> get_next)
: get_next_(get_next),
audio_(Phonon::MusicCategory),
file_active_(false)
{
  LOG("Player") << "Initialising";
  audio_path_ = Phonon::createPath(&media_,&audio_);
  connect(&media_, SIGNAL(aboutToFinish()), this, SLOT(EnqueueNext()));
  connect(&media_, SIGNAL(currentSourceChanged(const Phonon::MediaSource &)), this, SIGNAL(OnSourceChanged()));
  connect(&media_, SIGNAL(stateChanged(Phonon::State, Phonon::State)), this, SLOT(StatusChanged(Phonon::State, Phonon::State)));
}
Exemplo n.º 11
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    tcore(new ThunderCore (this)),
    tpanel(new ThunderPanel (this)),
    vpanel(new VideoPanel (this)),
    lpanel(new LogView (this)),
    bpanel(new Browser (this)),
    transf0r(new Transf0r (this)),
    osd(new OSD (this))
{
    ui->setupUi(this);
    setWindowTitle (tr("%1 $VER %2").arg(QApplication::applicationName())
                    .arg(QApplication::applicationVersion()));
    vpanel->setStatusBar(ui->statusBar);

    ui->tabWidget->addTab(tpanel, "Cloud");
    ui->tabWidget->addTab(vpanel, "Video");
    ui->tabWidget->addTab(bpanel, "Browser");
    ui->tabWidget->addTab(lpanel, "Log");
    ui->tabWidget->addTab(transf0r, "Transf0r");

    ///
    connect (tcore, SIGNAL(StatusChanged(ThunderCore::ChangeType)),
             SLOT(slotStatusChanged(ThunderCore::ChangeType)));
    connect (tcore, SIGNAL(error(QString,ThunderCore::ErrorCategory)),
             lpanel, SLOT(logReceived(QString,ThunderCore::ErrorCategory)));

    connect (tcore, SIGNAL(BTSubTaskReady(Thunder::BitorrentTask)),
             tpanel, SLOT(setBTSubTask(Thunder::BitorrentTask)));

    connect (tpanel, SIGNAL(doThisLink(Thunder::RemoteTask,
                                       ThunderPanel::RequestType,bool)),
             SLOT(slotRequestReceived(Thunder::RemoteTask,
                                      ThunderPanel::RequestType,bool)));

    connect (tpanel, SIGNAL(doIndirectRequest(ThunderPanel::IndirectRequestType)),
             SLOT(slotIndirectRequestReceived(ThunderPanel::IndirectRequestType)));

    connect (osd, SIGNAL(doubleClicked()), SLOT(slotShowOrHideWindow()));

    // WILL BE REMOVED LATER!
    connect (tcore, SIGNAL(error(QString,ThunderCore::ErrorCategory)),
             SLOT(slotError(QString,ThunderCore::ErrorCategory)));

    connect (bpanel, SIGNAL(browserLinksReady(QString)),
             SLOT(slotBrowserLinksReady(QString)));

    ///
    osd->osd_menu->addAction(ui->actionNewTask);
    osd->osd_menu->addSeparator();
    osd->osd_menu->addAction(ui->actionQ_uit);

    ///
    {
        QSettings settings;
        settings.beginGroup("UI");
        restoreState( settings.value("State").toByteArray());
        restoreGeometry( settings.value("Geometry").toByteArray() );
    }

    login ();
}
Exemplo n.º 12
0
    /**
     * Load an instrument from a .gig file. PrepareLoadInstrument() has to
     * be called first to provide the information which instrument to load.
     * This method will then actually start to load the instrument and block
     * the calling thread until loading was completed.
     *
     * @see PrepareLoadInstrument()
     */
    void EngineChannel::LoadInstrument() {
        InstrumentResourceManager* pInstrumentManager = dynamic_cast<InstrumentResourceManager*>(pEngine->GetInstrumentManager());

        // make sure we don't trigger any new notes with an old
        // instrument
        InstrumentChangeCmd< ::gig::DimensionRegion, ::gig::Instrument>& cmd = ChangeInstrument(0);
        if (cmd.pInstrument) {
            // give old instrument back to instrument manager, but
            // keep the dimension regions and samples that are in use
            pInstrumentManager->HandBackInstrument(cmd.pInstrument, this, cmd.pRegionsInUse);
        }
        if (cmd.pScript) {
            // give old instrument script back to instrument resource manager
            cmd.pScript->resetAll();
        }
        cmd.pRegionsInUse->clear();

        // delete all key groups
        DeleteGroupEventLists();

        // request gig instrument from instrument manager
        ::gig::Instrument* newInstrument;
        try {
            InstrumentManager::instrument_id_t instrid;
            instrid.FileName  = InstrumentFile;
            instrid.Index     = InstrumentIdx;

            newInstrument = pInstrumentManager->Borrow(instrid, this);
            if (!newInstrument) {
                throw InstrumentManagerException("resource was not created");
            }

            if (newInstrument->ScriptSlotCount() > 1) {
                std::cerr << "WARNING: Executing more than one real-time instrument script slot is not implemented yet!\n";
            }
            ::gig::Script* script = newInstrument->GetScriptOfSlot(0);
            if (script) {
                String sourceCode = script->GetScriptAsText();
                LoadInstrumentScript(sourceCode);
            }
        }
        catch (RIFF::Exception e) {
            InstrumentStat = -2;
            StatusChanged(true);
            String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message;
            throw Exception(msg);
        }
        catch (InstrumentManagerException e) {
            InstrumentStat = -3;
            StatusChanged(true);
            String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message();
            throw Exception(msg);
        }
        catch (...) {
            InstrumentStat = -4;
            StatusChanged(true);
            throw Exception("gig::Engine error: Failed to load instrument, cause: Unknown exception while trying to parse gig file.");
        }

        RoundRobinIndex = 0;
        for (int i = 0 ; i < 128 ; i++) pMIDIKeyInfo[i].pRoundRobinIndex = NULL;

        // rebuild ActiveKeyGroups map with key groups of current
        // instrument and set the round robin pointers to use one
        // counter for each region
        int region = 0;
        for (::gig::Region* pRegion = newInstrument->GetFirstRegion(); pRegion; pRegion = newInstrument->GetNextRegion()) {
            AddGroup(pRegion->KeyGroup);

            RoundRobinIndexes[region] = 0;
            for (int iKey = pRegion->KeyRange.low; iKey <= pRegion->KeyRange.high; iKey++) {
                pMIDIKeyInfo[iKey].pRoundRobinIndex = &RoundRobinIndexes[region];
            }
            region++;
        }

        InstrumentIdxName = newInstrument->pInfo->Name;
        InstrumentStat = 100;

        {
            InstrumentChangeCmd< ::gig::DimensionRegion, ::gig::Instrument>& cmd =
                ChangeInstrument(newInstrument);
            if (cmd.pScript) {
                // give old instrument script back to instrument resource manager
                cmd.pScript->resetAll();
            }
        }

        StatusChanged(true);
    }
Exemplo n.º 13
0
    /**
     * Load an instrument from a .sf2 file. PrepareLoadInstrument() has to
     * be called first to provide the information which instrument to load.
     * This method will then actually start to load the instrument and block
     * the calling thread until loading was completed.
     *
     * @see PrepareLoadInstrument()
     */
    void EngineChannel::LoadInstrument() {
        InstrumentResourceManager* pInstrumentManager = dynamic_cast<InstrumentResourceManager*>(pEngine->GetInstrumentManager());

        // make sure we don't trigger any new notes with an old
        // instrument
        InstrumentChangeCmd< ::sf2::Region, ::sf2::Preset>& cmd = ChangeInstrument(0);
        if (cmd.pInstrument) {
            // give old instrument back to instrument manager, but
            // keep the dimension regions and samples that are in use
            pInstrumentManager->HandBackInstrument(cmd.pInstrument, this, cmd.pRegionsInUse);
        }
        cmd.pRegionsInUse->clear();

        // delete all key groups
        DeleteGroupEventLists();

        // request sf2 instrument from instrument manager
        ::sf2::Preset* newInstrument;
        try {
            InstrumentManager::instrument_id_t instrid;
            instrid.FileName  = InstrumentFile;
            instrid.Index     = InstrumentIdx;

            newInstrument = pInstrumentManager->Borrow(instrid, this);
            if (!newInstrument) {
                throw InstrumentManagerException("resource was not created");
            }
        }
        catch (InstrumentManagerException e) {
            InstrumentStat = -3;
            StatusChanged(true);
            String msg = "sf2::Engine error: Failed to load instrument, cause: " + e.Message();
            throw Exception(msg);
        }
        catch (::sf2::Exception e) {
            InstrumentStat = -3;
            StatusChanged(true);
            String msg = "sf2::Engine error: Failed to load instrument, cause: " + e.Message;
            throw Exception(msg);
        }
        catch (::std::runtime_error e) {
            InstrumentStat = -3;
            StatusChanged(true);
            String msg = "sf2::Engine error: Failed to load instrument, cause: ";
            msg += e.what();
            throw Exception(msg);
        }
        catch (...) {
            InstrumentStat = -4;
            StatusChanged(true);
            throw Exception("sf2::Engine error: Failed to load instrument, cause: Unknown exception while trying to parse sf2 file.");
        }

        // rebuild ActiveKeyGroups map with key groups of current instrument
        for (int i = 0 ; i < newInstrument->GetRegionCount() ; i++) {
            ::sf2::Region* pRegion = newInstrument->GetRegion(i);
            for (int j = 0 ; j < pRegion->pInstrument->GetRegionCount() ; j++) {
                ::sf2::Region* pSubRegion = pRegion->pInstrument->GetRegion(j);
                AddGroup(pSubRegion->exclusiveClass);
            }
        }

        InstrumentIdxName = newInstrument->GetName();
        InstrumentStat = 100;

        ChangeInstrument(newInstrument);

        StatusChanged(true);
    }
Exemplo n.º 14
0
    void FarsightChannel::LinkIncomingSourcePad(TfStream *stream, GstPad *src_pad, FsCodec *codec)
    {           
        incoming_video_widget_mutex_.lock();

        // todo: Check if source pad is already linked!
        gint clock_rate = codec->clock_rate;
        audio_stream_in_clock_rate_ = clock_rate;
        gint channel_count = codec->channels;

        guint media_type;
        g_object_get(stream, "media-type", &media_type, NULL);

        GstPad *output_pad;
        GstElement *output_element = 0;

        bool sink_already_linked = false;

        switch (media_type)
        {
            case TP_MEDIA_STREAM_TYPE_AUDIO:
            {
                output_element = audio_playback_bin_;
                if (audio_in_src_pad_)
                    sink_already_linked = true;
                LogInfo("Got pad for incoming AUDIO stream.");
                break;
            }
            case TP_MEDIA_STREAM_TYPE_VIDEO:
            {
                if (!video_supported_)
                {
                    LogInfo("Got incoming VIDEO stream but ignore that because lack of video support.");
                    incoming_video_widget_mutex_.unlock();
                    return;
                }

                output_element = received_video_playback_element_;
                if (video_in_src_pad_)
                    sink_already_linked = true;
                LogDebug("Got pad for incoming VIDEO stream.");
                break;
            }
            default:
            {
                Q_ASSERT(false);
            }
        }

        if (sink_already_linked)
        {
            LogInfo("FarsightChannel: another Src pad added with same type.");
        }
        else
        {
            if (!gst_bin_add(GST_BIN(pipeline_), output_element))
            {
                LogWarning("Cannot and output element to GStreamer pipeline!");
            }
        }

        output_pad = gst_element_get_static_pad(output_element, "sink");
        if (!output_pad)
        {
            LogError("Cannot get sink pad from output element");
        }
        switch (media_type)
        {
            case TP_MEDIA_STREAM_TYPE_AUDIO:
            {
                if (audio_in_src_pad_)
                {
                    gst_pad_unlink(audio_in_src_pad_, output_pad);
                }
                audio_in_src_pad_ = src_pad;
                break;
            }
            case TP_MEDIA_STREAM_TYPE_VIDEO:
            {
                if (video_in_src_pad_)
                {
                    gst_pad_unlink(video_in_src_pad_, output_pad);
                }
                video_in_src_pad_ = src_pad;
                break;
            }
        }

        if (gst_pad_link(src_pad, output_pad) != GST_PAD_LINK_OK)
        {
            LogWarning("Cannot link audio src to output element.");
        }
        gst_element_set_state(output_element, GST_STATE_PLAYING);

        incoming_video_widget_mutex_.unlock();

        status_ = StatusConnected;
        emit StatusChanged(status_);
        switch (media_type)
        {
            case TP_MEDIA_STREAM_TYPE_AUDIO:
                emit AudioStreamReceived();
                break;
            case TP_MEDIA_STREAM_TYPE_VIDEO:
                emit VideoStreamReceived();
                break;
        }
    }
Exemplo n.º 15
0
LayerFCD::LayerFCD(LayerMRI* layerMRI, 
                   QObject *parent) : LayerVolumeBase(parent),
  m_fcd(NULL),
  m_mri_difference(NULL)
{
  m_strTypeNames.push_back( "FCD" );
  m_sPrimaryType = "FCD";
  mProperty = new LayerPropertyFCD(this);
  for ( int i = 0; i < 3; i++ )
  {
    m_dSlicePosition[i] = 0;
    m_sliceActor2D[i] = vtkSmartPointer<vtkImageActor>::New();
    m_sliceActor3D[i] = vtkSmartPointer<vtkImageActor>::New();
    m_sliceActor2D[i]->InterpolateOff();
    m_sliceActor3D[i]->InterpolateOff();
  }

  mProperty = new LayerPropertyFCD( this );

  m_layerSource = layerMRI;
  if (m_layerSource)
  {
    InitializeData();
  }

  LayerPropertyFCD* p = GetProperty();
  connect( p, SIGNAL(ColorMapChanged()), this, SLOT(UpdateColorMap()) );
  connect( p, SIGNAL(OpacityChanged(double)), this, SLOT(UpdateOpacity()) );
  connect( p, SIGNAL(ThicknessThresholdChanged(double)), 
           this, SLOT(Recompute()));
  connect( p, SIGNAL(SigmaChanged(double)), this, SLOT(Recompute()));
  connect( p, SIGNAL(MinAreaChanged(int)), this, SLOT(Recompute()));

  // pre allocate MRIs & surfaces
  m_mri_norm = new LayerMRI(NULL);
  m_mri_flair = new LayerMRI(NULL);
  m_mri_t2 = new LayerMRI(NULL);
  m_mri_aseg = new LayerMRI(NULL);
  m_mri_difference = new LayerMRI(NULL);
  connect(m_mri_norm, SIGNAL(destroyed()), 
          this, SLOT(OnLayerDestroyed()), Qt::UniqueConnection);
  connect(m_mri_flair, SIGNAL(destroyed()), 
          this, SLOT(OnLayerDestroyed()), Qt::UniqueConnection);
  connect(m_mri_t2, SIGNAL(destroyed()), 
          this, SLOT(OnLayerDestroyed()), Qt::UniqueConnection);
  connect(m_mri_aseg, SIGNAL(destroyed()), 
          this, SLOT(OnLayerDestroyed()), Qt::UniqueConnection);
  connect(m_mri_difference, SIGNAL(destroyed()),
          this, SLOT(OnLayerDestroyed()), Qt::UniqueConnection);

  m_surf_lh = new LayerSurface(NULL);
  m_surf_rh = new LayerSurface(NULL);
  connect(m_surf_lh, SIGNAL(destroyed()),
          this, SLOT(OnLayerDestroyed()), Qt::UniqueConnection);
  connect(m_surf_rh, SIGNAL(destroyed()),
          this, SLOT(OnLayerDestroyed()), Qt::UniqueConnection);
  m_surf_lh_pial = new LayerSurface(NULL);
  m_surf_rh_pial = new LayerSurface(NULL);
  connect(m_surf_lh_pial, SIGNAL(destroyed()),
          this, SLOT(OnLayerDestroyed()), Qt::UniqueConnection);
  connect(m_surf_rh_pial, SIGNAL(destroyed()),
          this, SLOT(OnLayerDestroyed()), Qt::UniqueConnection);

  m_surf_lh_sphere_d1 = new LayerSurface(NULL);
  m_surf_rh_sphere_d1 = new LayerSurface(NULL);
  connect(m_surf_lh_sphere_d1, SIGNAL(destroyed()),
          this, SLOT(OnLayerDestroyed()), Qt::UniqueConnection);
  connect(m_surf_rh_sphere_d1, SIGNAL(destroyed()),
          this, SLOT(OnLayerDestroyed()), Qt::UniqueConnection);

  m_worker = new LayerFCDWorkerThread(this);
  connect(m_worker, SIGNAL(started()), this, SIGNAL(StatusChanged()));
  connect(m_worker, SIGNAL(finished()), this, SIGNAL(StatusChanged()));
  connect(m_worker, SIGNAL(terminated()), this, SIGNAL(StatusChanged()));
}
Exemplo n.º 16
0
/***************************************************************************
 * Status
 ***************************************************************************/
void CNDSromScanner::Status(QString s, uint delay)
{
	emit StatusChanged(s, delay);
}
 void ScanProgress::SetTotalFileCount(int Count) {
     if (TotalFileCount == Count) return;
     TotalFileCount = Count;
     StatusChanged();
 }
Exemplo n.º 18
0
 void EngineChannel::SetSolo(bool solo) {
     if (p->bSolo == solo) return;
     p->bSolo = solo;
     StatusChanged(true);
 }
 void ScanProgress::SetScannedFileCount(int Count) {
     if (ScannedFileCount == Count) return;
     ScannedFileCount = Count;
     if (Count > TotalFileCount) TotalFileCount = Count;
     StatusChanged();
 }
 void ScanProgress::SetErrorStatus(int Err) {
     if (Err > 0) Err *= -1;
     Status = Err;
     StatusChanged();
 }
Exemplo n.º 21
0
 void EngineChannel::SetMidiInstrumentMapToDefault() {
     if (p->iMidiInstrumentMap == DEFAULT_MIDI_INSTRUMENT_MAP) return;
     p->iMidiInstrumentMap = DEFAULT_MIDI_INSTRUMENT_MAP;
     StatusChanged(true);
 }
Exemplo n.º 22
0
 void EngineChannel::SetMidiInstrumentMapToNone() {
     if (p->iMidiInstrumentMap == NO_MIDI_INSTRUMENT_MAP) return;
     p->iMidiInstrumentMap = NO_MIDI_INSTRUMENT_MAP;
     StatusChanged(true);
 }