예제 #1
0
int Scene_Test::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: initTestCase(); break;
        case 1: init(); break;
        case 2: cleanup(); break;
        case 3: initial(); break;
        case 4: values(); break;
        case 5: fixtureRemoval(); break;
        case 6: loadSuccess(); break;
        case 7: loadWrongType(); break;
        case 8: loadWrongRoot(); break;
        case 9: save(); break;
        case 10: copyFrom(); break;
        case 11: createCopy(); break;
        case 12: arm(); break;
        case 13: armMissingFixture(); break;
        case 14: armTooManyChannels(); break;
        case 15: flashUnflash(); break;
        case 16: writeHTPBusZero(); break;
        case 17: writeHTPBusOne(); break;
        case 18: writeLTPHTPBusZero(); break;
        case 19: writeLTPBusOne(); break;
        case 20: writeLTPReady(); break;
        case 21: writeValues(); break;
        default: ;
        }
        _id -= 22;
    }
    return _id;
}
예제 #2
0
DocumentPage::DocumentPage(const QString& filePath, QGraphicsItem *parent)
    : MApplicationPage(parent)
    , currentPage(1)
    , m_pinchInProgress(false)
    , m_endScale(1.0)
    , m_blockRecenter(false)
    , pageLoaded(false)
    , m_defaultZoomLevelAction(ActionPool::ZoomFitToWidth)
    , pageIndicator(0)
    , m_infoBanner(0)
    , shareIf(0)
    , searchstring("")
    , searchingTimeout(false)
    , zoomAction(0)
    , indicatorAction(0)
    , zoomCombobox(0)
    , indicatorCombobox(0)
    , searchStarted(false)
    , noMatches(false)
    , totalPage(1)
    , liveDocument(0)
    , bounceAnimation(0)
    , jumpToPageOverlay(0)
    , findtoolbar(0)
    , quickViewToolbar(0)
    , quickViewer(false)
    , m_pageView(new ZoomBackground(this))
    , m_lastZoomFactor(1.0)
{
    setView(m_pageView);
    documentName = filePath;
    setObjectName("documentpage");

    // double click interval setting to 325ms
    QApplication::setDoubleClickInterval(DOUBLETAP_INTERVAL);

    setAutoMarginsForComponentsEnabled(false);
    setComponentsDisplayMode(MApplicationPage::AllComponents, MApplicationPageModel::Hide);
    setEscapeMode(MApplicationPageModel::EscapeCloseWindow);
    qRegisterMetaType<ZoomLevel>("ZoomLevel");
    m_autoHideTimer.setSingleShot(true);
    m_autoHideTimer.setInterval(NAVI_BAR_TIMEOUT);

    m_shortTapTimer.setSingleShot(true);
    m_shortTapTimer.setInterval(QApplication::doubleClickInterval());

    searchTimer.setSingleShot(true);
    searchTimer.setInterval(searchDelay);

    connect(&searchTimer, SIGNAL(timeout()), this, SLOT(searchTimeout()));
    connect(&m_shortTapTimer, SIGNAL(timeout()), this, SLOT(shortTapEvent()));
    connect(&m_autoHideTimer, SIGNAL(timeout()), this, SLOT(autoHideToolbar()));
    connect(this, SIGNAL(backButtonClicked()), this, SLOT(onClose()));
    connect(ActionPool::instance(), SIGNAL(destroyed(QObject *)), this, SLOT(removeActions()));
    connect(this, SIGNAL(loadSuccess(QString)), SLOT(updateViewerType()));
    connect(MInputMethodState::instance(), SIGNAL(inputMethodAreaChanged(const QRect &)), this, SLOT(sendVisibleAreayChanged()));
}
예제 #3
0
bool KNMusicBackendBassThread::loadFile(const QString &filePath)
{
    //Stop the current thread first.
    stop();
    //Remove all the previous sync handlers.
    removeChannelSyncs();
    //Check is the file the current file.
    if(filePath==m_filePath)
    {
        //Reset the current state.
        resetChannelInformation();
        //Update the duration.
        emit durationChanged(m_duration);
        //Emit the load success signal.
        emit loadSuccess();
        //Mission complete.
        return true;
    }
    //Load the file path.
    if(!loadBassThread(filePath))
    {
        //Load the file failed.
        return false;
    }
    //When loading the file complete, load the channel info to the thread.
    //Get the duration of the whole file.
    m_totalDuration=
            BASS_ChannelBytes2Seconds(m_channel,
                                      BASS_ChannelGetLength(m_channel,
                                                            BASS_POS_BYTE))
            *1000.0;
    //Emit the duration changed signal.
    emit durationChanged(m_totalDuration);
    //Reset the thread information.
    resetChannelInformation();
    //Load complete.
    return true;
}
예제 #4
0
void KNMusicBackendQtAVThread::onActionLoaded()
{
    //Update the volume size.
    if(m_player->audio())
    {
        //Set the volume size.
        m_player->audio()->setVolume(m_volumeSize);
    }
    //Set the start and end position.
    m_player->setStartPosition(m_startPosition);
    //Set the end position.
    m_player->setStopPosition(m_endPosition);
    //Check out the end position is 0 or not.
    if(m_endPosition==0)
    {
        //Change the end position to the media stop position.
        m_endPosition=m_player->duration()-100;
    }
    //Get the duration of the player.
    emit durationChanged(m_endPosition - m_startPosition);
    //Emit the loaded success signal.
    emit loadSuccess();
}
예제 #5
0
bool KNMusicBackendMpvThread::event(QEvent *event)
{
    //Check out the event type.
    if(event->type()==QEvent::User)
    {
        //Get all the event until there no event.
        while(m_mpvHandle)
        {
            //Get the mpv event.
            mpv_event *mpvEvent=mpv_wait_event(m_mpvHandle, 0);
            //Check out the event pointer.
            if(mpvEvent==nullptr ||
                    MPV_EVENT_NONE == mpvEvent->event_id)
            {
                //All the event has been processed.
                break;
            }
            //Check out whether there's an error occurs.
            if(mpvEvent->error < 0)
            {
                //!FIXME: Do something here.
            }
            switch(mpvEvent->event_id)
            {
            case MPV_EVENT_PROPERTY_CHANGE:
            {
                //Cast the mpv event data to event property.
                mpv_event_property *prop=(mpv_event_property *)mpvEvent->data;
                //Check out the property name.
                // From bakamplayer:
                // playback-time does the same thing as time-pos but works for
                // streaming media
                if(strcmp(prop->name, "time-pos") == 0)
                {
                    //Cehck the format.
                    if(MPV_FORMAT_DOUBLE==prop->format)
                    {
                        //Output the playback time.
                        emit positionChanged((qint64)((*(double *)prop->data)*1000.0)-m_startPosition);
                    }
                }
                //Mission finished.
                break;
            }
                //This event is totally different, though I don't know why.
                //BakaMPlayer says it is.
            case MPV_EVENT_START_FILE:
            {
                break;
            }
            case MPV_EVENT_FILE_LOADED:
            {
                //Pause it right after the file loaded.
                pause();
                //Reset the playing state.
                m_state=MusicUtil::Stopped;
                //Emit the state changed signal.
                emit stateChanged(m_state);
                //We have to update all the file inforamtion here.
                //Get the duration of the file.
                double mediaDuration;
                //Get the property.
                mpv_get_property(m_mpvHandle,
                                 "length",
                                 MPV_FORMAT_DOUBLE,
                                 &mediaDuration);
                //Save the total duration.
                qint64 propertyDuration=(qint64)(mediaDuration*1000.0);
                //Check property duration
                if(propertyDuration>0)
                {
                    //For valid duration.
                    m_totalDuration=propertyDuration;
                    //Update the end position.
                    checkStartAndEndPosition();
                    //Emit the loaded signal.
                    emit loadSuccess();
                }
                //Mission complete.
                break;
            }
            case MPV_EVENT_PAUSE:
            {
                //We should save the state as pause.
                //We may never have stop.
                m_state=MusicUtil::Paused;
                //Emit the state changed signal.
                emit stateChanged(m_state);
                break;
            }
            case MPV_EVENT_UNPAUSE:
            {
                //We should save the state as playing.
                m_state=MusicUtil::Playing;
                //Emit the state changed signal.
                emit stateChanged(m_state);
                //Sync the playing volume.
                setVolume(m_volumeSize);
                break;
            }
            case MPV_EVENT_END_FILE:
            {
                //It should be stopped.
                m_state=MusicUtil::Stopped;
                //Emit the state changed signal.
                emit stateChanged(m_state);
                break;
            }
            }
        }
    }
    //For others, do the defualt event.
    return KNMusicStandardBackendThread::event(event);
}
예제 #6
0
QHotLoadImageBay::QHotLoadImageBay() : QObject(), dirHint(D_NEUTRAL) {
    qsrand(time(0));
    QObject::connect(&qiltp, SIGNAL(loadSuccess(QString,QImage)), this, SLOT(handleSuccess(QString,QImage)), Qt::DirectConnection);
    QObject::connect(&qiltp, SIGNAL(loadFailed(QString)), this, SLOT(handleFailure(QString)), Qt::DirectConnection);
    this->startTimer(50);
}
예제 #7
0
void QImageLoadThreadPool::internalThreadEnd(QString path, QImage img) {
    this->internalJoinThread(path);
    controlExternal.lock();
    if (img.isNull()) emit loadFailed(path); else emit loadSuccess(path, img);
    controlExternal.unlock();
}