Beispiel #1
0
void MediaObject::controlAvailable(QString const& name)
{
    if (name == QMediaControl::name() && !d->valid) {
        d->control = new QMediaControl(d->content);
        connect(d->control, SIGNAL(playerStateChanged(QtopiaMedia::State)), SLOT(playerStateChanged(QtopiaMedia::State)));
        connect(d->control, SIGNAL(lengthChanged(quint32)), SLOT(lengthChanged(quint32)));

        d->valid = true;

        // Connect peers
        foreach (MediaNode* peer, d->peers)
            peer->setContent(d->content);

        switch (d->requiredState) {
        case QtopiaMedia::Playing:
            d->control->start();
            break;
        default:
            ;
        }
    }

    bool hasVideo = d->content->controls().contains(QMediaVideoControl::name());

    if (hasVideo != d->hasVideo)
        emit hasVideoChanged(d->hasVideo = hasVideo);
}
void pf_Frag_Text::adjustOffsetLength(PT_BufIndex bi, UT_uint32 newLength)
{
	m_bufIndex = bi;
	UT_sint32 delta = static_cast<UT_sint32>(newLength) -  static_cast<UT_sint32>(m_length);
	m_length = newLength;
	lengthChanged(delta);
}
Beispiel #3
0
void MacroCart::UpdateLength()
{
    if(rdcart_events->length()!=rdcart_length) {
        rdcart_length=rdcart_events->length();
        emit lengthChanged(rdcart_length);
    }
}
Beispiel #4
0
void TimeLineCells::resizeEvent( QResizeEvent* event )
{
    clearCache();
    updateContent();
    event->accept();
    emit lengthChanged( getFrameLength() );
}
void Round::setLength(const QTime &length)
{
	if(length == this->length())
		return;
	setValue(RoundProperties::LengthAttribute,QVariant::fromValue<QTime>(length));
	emit lengthChanged(length);
}
void pf_Frag_Text::changeLength(UT_uint32 newLength)
{
	UT_ASSERT_HARMLESS(newLength > 0);
	UT_sint32 delta = static_cast<UT_sint32>(newLength) -  static_cast<UT_sint32>(m_length);
	m_length = newLength;
	lengthChanged(delta);
}
Beispiel #7
0
void graphModel::setLength( int _length )
{
	if( _length != length() )
	{
		m_samples.resize( _length );
		emit lengthChanged();
	}
}
Beispiel #8
0
void JSKitLocalStorage::checkLengthChanged()
{
    int curLen = _storage->allKeys().size();
    if (_len != curLen) {
        _len = curLen;
        emit lengthChanged();
    }
}
void UnitsSettings::setLength(int value)
{
	QSettings s;
	s.beginGroup(group);
	s.setValue("length", value);
	prefs.units.length = (units::LENGHT) value;
	emit lengthChanged(value);
}
AudioPlaybackBlock::AudioPlaybackBlock(MainController* controller, QString uid)
    : BlockBase(controller, uid)
    , m_playNode(nullptr)
    , m_pauseNode(nullptr)
    , m_toggleNode(nullptr)
    , m_activeNode(nullptr)
    , m_endNode(nullptr)
    , m_positionNode(nullptr)
    , m_filePath("")
    , m_lastPlayNodeValue(0.0)
    , m_lastPauseNodeValue(0.0)
    , m_lastToggleNodeValue(0.0)
    , m_alwaysStartAtBegin(false)
    , m_loop(false)
    , m_toggleMode(true)
    , m_player(this)
{
    m_widthIsResizable = true;

    m_playNode = createInputNode("playNode");
    m_pauseNode = createInputNode("pauseNode");
    m_toggleNode = createInputNode("toggleNode");
    connect(m_playNode, SIGNAL(dataChanged()), this, SLOT(onPlayNodeValueChanged()));
    connect(m_pauseNode, SIGNAL(dataChanged()), this, SLOT(onPauseNodeValueChanged()));
    connect(m_toggleNode, SIGNAL(dataChanged()), this, SLOT(onToggleNodeValueChanged()));

    m_activeNode = createOutputNode("activeNode");
    m_endNode = createOutputNode("endNode");
    m_positionNode = createOutputNode("positionNode");

    // setup Timer to be able to send a short pulse when end of file is reached:
    m_endPulseTimer.setSingleShot(true);
    m_endPulseTimer.setInterval(100);
    connect(&m_endPulseTimer, SIGNAL(timeout()), this, SLOT(onEndPulseTimeout()));

    connect(&m_player, SIGNAL(endOfFile()), this, SLOT(onEndOfFile()));
    connect(&m_player, SIGNAL(isPlayingChanged()), this, SIGNAL(isPlayingChanged()));
    connect(&m_player, SIGNAL(isPlayingChanged()), this, SLOT(onIsPlayingChanged()));
    connect(&m_player, SIGNAL(positionChanged()), this, SIGNAL(playbackPositionChanged()));
    connect(&m_player, SIGNAL(positionChanged()), this, SLOT(onPlaybackPositionChanged()));
    connect(&m_player, SIGNAL(lengthChanged()), this, SIGNAL(lengthChanged()));

    connect(&m_waveform, SIGNAL(pointsChanged()), this, SIGNAL(waveformChanged()));
    connect(&m_waveform, SIGNAL(availableChanged()), this, SIGNAL(waveformChanged()));
}
Beispiel #11
0
void Graph::modelChanged()
{
	graphModel * gModel = castModel<graphModel>();

	QObject::connect( gModel, SIGNAL( samplesChanged( int, int ) ),
			this, SLOT( updateGraph( int, int ) ) );

	QObject::connect( gModel, SIGNAL( lengthChanged( ) ),
			this, SLOT( updateGraph( ) ) );
}
Beispiel #12
0
void
MetaDataWorker::computeDynamicFileMetaData()
{
    //Disabling audio for this specific use of the media
    if ( m_media->fileType() == Media::Audio )
        m_media->addVolatileParam( ":volume 0", ":volume 512" );
    else
        m_media->addVolatileParam( ":no-audio", ":audio" );
    connect( m_mediaPlayer, SIGNAL( lengthChanged( qint64 ) ),
             this, SLOT( entrypointLengthChanged( qint64 ) ), Qt::QueuedConnection );
}
Beispiel #13
0
void CapsuleMesh::setLength(float length)
{
    if (qFuzzyCompare(length, 1))
        length = 1.0f;
    if (d->length != length) {
        d->length = length;
        createGeometry(true);
        emit lengthChanged();
        emit dataChanged();
    }
}
void Box2DDistanceJoint::setLength(float length)
{
    if (mLength == length / scaleRatio)
        return;

    mOverrideAnchorLength = true;
    mLength = length / scaleRatio;

    if (mDistanceJoint)
        mDistanceJoint->SetLength(length / scaleRatio);
    emit lengthChanged();
}
Beispiel #15
0
void graphModel::setLength( int _length )
{
	if( _length != m_length )
	{
		m_length = _length;
		if( m_samples.size() < m_length )
		{
			m_samples.resize( m_length );
		}
		emit lengthChanged();
	}
}
Beispiel #16
0
void
MainWorkflow::lengthUpdated( qint64 )
{
    qint64  maxLength = 0;

    for ( unsigned int i = 0; i < Workflow::NbTrackType; ++i )
    {
        if ( m_tracks[i]->getLength() > maxLength )
            maxLength = m_tracks[i]->getLength();
    }
    if ( m_lengthFrame != maxLength )
    {
        m_lengthFrame = maxLength;
        emit lengthChanged( m_lengthFrame );
    }
}
Beispiel #17
0
bitInvader::bitInvader( InstrumentTrack * _instrument_track ) :
	Instrument( _instrument_track, &bitinvader_plugin_descriptor ),
	m_sampleLength( 128, 4, 200, 1, this, tr( "Samplelength" ) ),
	m_graph( -1.0f, 1.0f, 128, this ),
	m_interpolation( false, this ),
	m_normalize( false, this )
{

	m_graph.setWaveToSine();

	connect( &m_sampleLength, SIGNAL( dataChanged( ) ),
			this, SLOT( lengthChanged( ) ) );

	connect( &m_graph, SIGNAL( samplesChanged( int, int ) ),
			this, SLOT( samplesChanged( int, int ) ) );

}
Beispiel #18
0
void song::updateLength()
{
	m_length = 0;
	m_tracksMutex.lockForRead();
	for( TrackList::const_iterator it = tracks().begin();
						it != tracks().end(); ++it )
	{
		const tact_t cur = ( *it )->length();
		if( cur > m_length )
		{
			m_length = cur;
		}
	}
	m_tracksMutex.unlock();

	emit lengthChanged( m_length );
}
Beispiel #19
0
void MidiDecoder::start()
{
    if (!d->initialized)
    {
        QIODevice::open(QIODevice::ReadWrite | QIODevice::Unbuffered);

        d->options.rate        = d->outputInfo.frequency;
        d->options.format      = MID_AUDIO_S16LSB;  // 16
        d->options.channels    = d->outputInfo.channels;
        d->options.buffer_size = MIDI_BUFFER_SIZE / (16 * 2 / 8);

        d->midiStream = mid_istream_open_callbacks(midiReadCallback,
                                                  midiCloseCallback,
                                                  this);

        d->song = mid_song_load(d->midiStream, &d->options);

        if (d->song != 0)
        {
            d->state = QtopiaMedia::Playing;

            d->length = mid_song_get_total_time(d->song);
            emit lengthChanged(d->length);

            mid_song_set_volume(d->song, d->muted ? 0 : d->volume * 2);

            mid_song_start(d->song);

            d->initialized = true;
        }
        else {
            qLog(Media) << "MidiDecoder::start(); Failed to load MIDI file";
            d->state = QtopiaMedia::Error;
        }
    }
    else
        d->state = QtopiaMedia::Playing;

    if (d->initialized) {
        emit readyRead();
        emit playerStateChanged(d->state);
    }
}
Beispiel #20
0
WorkflowRenderer::WorkflowRenderer( Backend::IBackend* backend, MainWorkflow* mainWorkflow )
    : m_mainWorkflow( mainWorkflow )
    , m_stopping( false )
    , m_outputFps( 0.0f )
    , m_aspectRatio( "" )
    , m_silencedAudioBuffer( NULL )
    , m_nbChannels( 2 )
    , m_rate( 48000 )
    , m_oldLength( 0 )
    , m_effectFrame( NULL )
{
    m_source = backend->createMemorySource();
    m_esHandler = new EsHandler;
    m_esHandler->self = this;

    connect( m_mainWorkflow, SIGNAL( frameChanged( qint64, Vlmc::FrameChangedReason ) ),
             this, SIGNAL( frameChanged( qint64, Vlmc::FrameChangedReason ) ) );
    connect( m_mainWorkflow, SIGNAL( lengthChanged( qint64 ) ),
             this, SLOT(mainWorkflowLenghtChanged(qint64) ) );
}
Beispiel #21
0
graph::graph( QWidget * _parent, graphStyle _style ) :
	QWidget( _parent ),
	/* TODO: size, background? */
	ModelView( new graphModel( -1.0, 1.0, 128, NULL, true ), this ),
	m_graphStyle( _style )
{
	m_mouseDown = false;
	m_graphColor = QColor( 0xFF, 0xAA, 0x00 );

	resize( 132, 104 );
	setAcceptDrops( true );
	setCursor( Qt::CrossCursor );

	graphModel * gModel = castModel<graphModel>();

	QObject::connect( gModel, SIGNAL( samplesChanged( int, int ) ),
			this, SLOT( updateGraph( int, int ) ) );

	QObject::connect( gModel, SIGNAL( lengthChanged( ) ),
			this, SLOT( updateGraph( ) ) );
}
Beispiel #22
0
//Must be called from a thread safe method (m_clipsLock locked)
void
TrackWorkflow::computeLength()
{
    bool    changed = false;
    if ( m_clips.count() == 0 )
    {
        if ( m_length != 0 )
            changed = true;
        m_length = 0;
    }
    else
    {
        QMap<qint64, ClipWorkflow*>::const_iterator it = m_clips.end() - 1;
        qint64  newLength = it.key() + it.value()->getClipHelper()->length();
        if ( m_length != newLength )
            changed = true;
        m_length = newLength;
    }
    if ( changed == true )
        emit lengthChanged( m_length );
}
MultitapEchoControls::MultitapEchoControls( MultitapEchoEffect * eff ) :
	EffectControls( eff ),
	m_effect( eff ),
	m_steps( 16, 4, 32, this, "Steps" ),
	m_stepLength( 100.0f, 1.0f, 500.0f, 0.1f, 500.0f, this, "Step length" ),
	m_dryGain( 0.0f, -80.0f, 20.0f, 0.1f, this, "Dry gain" ),
	m_swapInputs( false, this, "Swap inputs" ),
	m_stages( 1.0f, 1.0f, 4.0f, 1.0f, this, "Lowpass stages" ),
	m_ampGraph( -60.0f, 0.0f, 16, this ),
	m_lpGraph( 0.0f, 3.0f, 16, this )
{
	m_stages.setStrictStepSize( true );
	connect( &m_ampGraph, SIGNAL( samplesChanged( int, int ) ), this, SLOT( ampSamplesChanged( int, int ) ) );
	connect( &m_lpGraph, SIGNAL( samplesChanged( int, int ) ), this, SLOT( lpSamplesChanged( int, int ) ) );

	connect( &m_steps, SIGNAL( dataChanged() ), this, SLOT( lengthChanged() ) );
	connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) );

	setDefaultAmpShape();
	setDefaultLpShape();
}
Beispiel #24
0
void Song::updateLength()
{
	m_length = 0;
	m_tracksMutex.lockForRead();
	for( TrackList::const_iterator it = tracks().begin();
						it != tracks().end(); ++it )
	{
		if( Engine::getSong()->isExporting() &&
				( *it )->isMuted() )
		{
			continue;
		}

		const tact_t cur = ( *it )->length();
		if( cur > m_length )
		{
			m_length = cur;
		}
	}
	m_tracksMutex.unlock();

	emit lengthChanged( m_length );
}
Beispiel #25
0
MainWorkflow::MainWorkflow( int trackCount ) :
        m_blackOutput( NULL ),
        m_lengthFrame( 0 ),
        m_renderStarted( false ),
        m_width( 0 ),
        m_height( 0 ),
        m_trackCount( trackCount )
{
    m_currentFrameLock = new QReadWriteLock;
    m_renderStartedMutex = new QMutex;

    m_tracks = new TrackHandler*[Workflow::NbTrackType];
    m_currentFrame = new qint64[Workflow::NbTrackType];
    for ( unsigned int i = 0; i < Workflow::NbTrackType; ++i )
    {
        Workflow::TrackType trackType = static_cast<Workflow::TrackType>(i);
        m_tracks[i] = new TrackHandler( trackCount, trackType );
        connect( m_tracks[i], SIGNAL( tracksEndReached() ),
                 this, SLOT( tracksEndReached() ) );
        connect( m_tracks[i], SIGNAL( lengthChanged(qint64) ),
                 this, SLOT( lengthUpdated( qint64 ) ) );
        m_currentFrame[i] = 0;
    }
}
Beispiel #26
0
MusicControl::MusicControl(QWidget *parent) : QWidget(parent)
{
    setStyleSheet("QPushButton{ background-color: transparent; border: none; color:white; }"
                  "QPushButton:pressed{ background-color: qradialgradient(spread:pad, cx:0.468355, cy:0.472, radius:0.449, fx:0.472658, fy:0.477045, stop:0.261603 rgba(255, 255, 255, 130), stop:1 rgba(255, 255, 255, 0));}"
                  "QPushButton:checked{ background-color: qradialgradient(spread:pad, cx:0.468355, cy:0.472, radius:0.449, fx:0.472658, fy:0.477045, stop:0.261603 rgba(255, 255, 255, 130), stop:1 rgba(255, 255, 255, 0));}"
                  "QLabel{ color:white; }");

    m_c = Core::instance();
    connect(m_c, SIGNAL(lengthChanged()), this, SLOT(updateTime()));
    connect(m_c, SIGNAL(posChanged(int)), this, SLOT(updateTime()));
    connect(m_c, SIGNAL(tagsChanged()), this, SLOT(showTags()));
    connect(m_c, SIGNAL(currentMusicChanged()), this, SLOT(musicChanged()));
    connect(m_c, SIGNAL(videoAppearanceChanged(bool)), this, SLOT(moveWidgets()));
    connect(m_c, SIGNAL(isPlayingChanged()), this, SLOT(isPlayingChanged()));

    m_cover = new Cover(this);

    m_musicTagsLabel = new QLabel(this);
    m_musicTagsLabel->setAlignment(Qt::AlignCenter);
    m_musicTagsLabel->setText(QString(tr("<b>Welcome!</b>")));
    QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
    shadowEffect->setOffset(1, 1);
    m_musicTagsLabel->setGraphicsEffect(shadowEffect);

//Player button, slider and label
    m_previousButton = new QPushButton(this);
    m_previousButton->setIcon(QIcon(QString(":/Player_Previous.png")));
    m_previousButton->setIconSize(QSize(32, 32));
    m_previousButton->setShortcut(QKeySequence(Qt::Key_Left));
    m_previousButton->setToolTip(tr("Previous media in the playlist"));
    connect(m_previousButton, SIGNAL(clicked()), this, SLOT(previous()));

    m_playButton = new QPushButton(this);
    m_playButton->setIcon(QIcon(QString(":/Player_Play.png")));
    m_playButton->setIconSize(QSize(50, 50));
    m_playButton->setShortcut(QKeySequence(Qt::Key_Space));
    m_playButton->setToolTip(tr("Play/Pause"));
    connect(m_playButton, SIGNAL(clicked()), this, SLOT(play()));

    m_nextButton = new QPushButton(this);
    m_nextButton->setIcon(QIcon(QString(":/Player_Next.png")));
    m_nextButton->setIconSize(QSize(32, 32));
    m_nextButton->setShortcut(QKeySequence(Qt::Key_Right));
    m_nextButton->setToolTip(tr("Next media in the playlist"));
    connect(m_nextButton, SIGNAL(clicked()), this, SLOT(next()));

    m_volumeIcon = new QPushButton(this);
    m_volumeIcon->setIcon(QIcon(":/Volume.png"));
    m_volumeIcon->setIconSize(m_volumeIcon->size());
    m_volumeIcon->setToolTip(tr("Mute or not"));
    connect(m_volumeIcon, SIGNAL(clicked()), this, SLOT(mute()));
    m_volumeIcon->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));

    m_volumeSlider = new QSlider(this);
    m_volumeSlider->setOrientation(Qt::Vertical);
    m_volumeSlider->setToolTip(tr("Change the volume"));
    m_volumeSlider->setValue(m_c->volume());
    m_volumeSlider->setMaximum(200);
    connect(m_volumeSlider, SIGNAL(valueChanged(int)), m_c, SLOT(setVolume(int)));

    m_seekSlider = new QSlider(this);
    m_seekSlider->setOrientation(Qt::Horizontal);
    m_seekSlider->setToolTip(tr("Change the position in the media"));
    connect(m_seekSlider, SIGNAL(sliderMoved(int)), m_c, SLOT(setPosition(int)));

    m_timeLabel = new QLabel(this);
    m_timeLabel->setMinimumSize(150, 0);
    m_timeLabel->setAlignment(Qt::AlignRight);
    m_timeLabel->setText("0:00 / 0:00");

    m_randButton = new QPushButton(this);
    m_randButton->setIconSize(QSize(22, 22));
    m_randButton->setIcon(QIcon(QString(":/Random.png")));
    m_randButton->setCheckable(true);
    m_randButton->setToolTip(tr("Random medias in the playlist or not"));
    m_randButton->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));

    m_repeatButton = new QPushButton(this);
    m_repeatButton->setIconSize(QSize(22, 22));
    m_repeatButton->setIcon(QIcon(QString(":/Repeat.png")));
    m_repeatButton->setCheckable(true);
    m_repeatButton->setToolTip(tr("Repeat the media or not"));
    m_repeatButton->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));

    moveWidgets();
}
Beispiel #27
0
void VideoData::setLength(int len) {
    m_length=len;
    emit lengthChanged();
    emit totalTimeStrChanged();
}
Beispiel #28
0
void Exercise::setLength(int length) {

    emit lengthChanged(currentLength);
}
void
ConstraintTypes::PlaylistLengthEditWidget::on_spinBox_Length_valueChanged( const int l )
{
    emit lengthChanged( l );
    emit updated();
}
Beispiel #30
0
void JSKitLocalStorage::clear()
{
    _storage->clear();
    _len = 0;
    emit lengthChanged();
}