コード例 #1
0
ファイル: subbarplayer.cpp プロジェクト: chunyisu/hdass
void SubBarPlayer::xSetup()
{
   //DAVID Setup Background;
   pixBackground.load("/root/kde_application/hdass08/skin/SubBarBackground.png");
   setBackgroundPixmap(pixBackground);
   
   //DAVID Load BtnGraphic
   BtnGraphic[0]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Previous.png");
   BtnGraphic[1]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Previous-Active.png");
   BtnGraphic[2]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Play.png");
   BtnGraphic[3]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Play-Active.png");
   BtnGraphic[4]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Pause.png");
   BtnGraphic[5]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Pause-Active.png");
   BtnGraphic[6]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Next.png");
   BtnGraphic[7]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Next-Active.png");
  
   
   SubBtnPlayer_PlayNPause =new SkinButton(this);
   SubBtnPlayer_Backword     =new SkinButton(this);
   SubBtn_Forward                =new SkinButton(this);
   
   SubBtnPlayer_Backword->setPixmaps(BtnGraphic[0],BtnGraphic[1]);
   SubBtnPlayer_Backword->setGeometry(336,0,60,80);
   SubBtnPlayer_Backword->show();
   
   SubBtnPlayer_PlayNPause->setPixmaps(BtnGraphic[2],BtnGraphic[3]);
   SubBtnPlayer_PlayNPause->setGeometry(403,0,80,80);
   SubBtnPlayer_PlayNPause->show();
   
   SubBtn_Forward->setPixmaps(BtnGraphic[6],BtnGraphic[7]);
   SubBtn_Forward->setGeometry(484,0,60,80);
   SubBtn_Forward->show();
   
   //DAVID Pos Slider
   playerPosition = new QSlider(0,100,1,0,Qt::Horizontal,this);
   playerPosition->setGeometry( QRect(10,39,300,15) );
   //playerPosition->show();
   
   
   QObject::connect(SubBtnPlayer_PlayNPause, SIGNAL(clicked()), m_player, SLOT(play()));
   QObject::connect(SubBtnPlayer_PlayNPause,SIGNAL(clicked()),this,SLOT(ChangeBtnPlayPauseGraphic()));
   QObject::connect(SubBtn_Forward, SIGNAL(clicked()), m_player, SLOT(next()));
   QObject::connect(SubBtnPlayer_Backword, SIGNAL(clicked()), m_player, SLOT(previous()));

   state=SubBarPlayer::GO;
   
   connect(m_player, SIGNAL(positionMessage(int)), this, SLOT(handlePosition(int )));
   connect(m_player,SIGNAL(trackMessage(int, int, QString, QString, QString )),this,SLOT(handleMessage(int, int, QString, QString, QString )));
   connect(playerPosition, SIGNAL(sliderPressed()), this, SLOT(handleSliderPressed()));
   connect(playerPosition, SIGNAL(sliderReleased()), this, SLOT(handleSliderReleased()));
   
    forwardTimer = new QTimer( this ); // create internal timer
    connect( forwardTimer, SIGNAL(timeout()),this, SLOT(handleForward()) );

    
    backwardTimer = new QTimer( this );
    connect( backwardTimer, SIGNAL(timeout()), this, SLOT(handleBackward()) );
    
    slotReadList();
}
コード例 #2
0
	SeekSlider::SeekSlider (SourceObject *source, QWidget *parent)
	: QWidget (parent)
	, Source_ (source)
	, IgnoreNextValChange_ (false)
	, IsPressed_ (false)
	{
		Ui_.setupUi (this);

		connect (source,
				SIGNAL (currentSourceChanged (AudioSource)),
				this,
				SLOT (updateRanges ()));
		connect (source,
				SIGNAL (totalTimeChanged (qint64)),
				this,
				SLOT (updateRanges ()));
		connect (source,
				SIGNAL (tick (qint64)),
				this,
				SLOT (handleCurrentPlayTime (qint64)));
		connect (source,
				SIGNAL (stateChanged (SourceState, SourceState)),
				this,
				SLOT (handleStateChanged ()));

		connect (Ui_.Slider_,
				SIGNAL (sliderPressed ()),
				this,
				SLOT (handleSliderPressed ()));
		connect (Ui_.Slider_,
				SIGNAL (sliderReleased ()),
				this,
				SLOT (handleSliderReleased ()));
	}
コード例 #3
0
VideoControls::VideoControls(QWidget *parent) : QFrame (parent) {
    setEnabled(false);
    m_isTracking = false;
    m_isPlaying = false;
    m_autoHide = false;

    m_hbox = new QHBoxLayout(this);
    m_hbox->setSizeConstraint(QLayout::SetMinimumSize);
    m_hbox->setContentsMargins(0,0,0,0);
    m_hbox->setSpacing(4);
    
    m_prevButton = new QToolButton(this);
    m_hbox->addWidget(m_prevButton);
    m_prevButton->setFixedSize(24, 24);
    m_prevButton->setAutoRaise(true);
    m_prevButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_MediaSeekBackward));
	m_prevButton->setAutoRepeat(true);
	m_prevButton->setAutoRepeatInterval(1000/50); 

    m_playButton = new QToolButton(this);;
    m_hbox->addWidget(m_playButton);
    m_playButton->setFixedSize(24, 24);
    m_playButton->setAutoRaise(true);
    m_playButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_MediaPlay));

    m_nextButton = new QToolButton(this);;
    m_hbox->addWidget(m_nextButton);
    m_nextButton->setFixedSize(24, 24);
    m_nextButton->setAutoRaise(true);
    m_nextButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_MediaSeekForward));
	m_nextButton->setAutoRepeat(true);
	m_nextButton->setAutoRepeatInterval(1000/50); 

    m_frameSlider = new QSlider(this);
    m_hbox->addWidget(m_frameSlider);
    m_frameSlider->setMinimumHeight(24);
    m_frameSlider->setRange(0,0);
    m_frameSlider->setFocusPolicy(Qt::NoFocus);
    m_frameSlider->setOrientation(Qt::Horizontal);
    m_frameSlider->setTracking(false);

    m_frameEdit = new QSpinBox(this);
    m_hbox->addWidget(m_frameEdit);
    m_frameEdit->setMinimumHeight(24);
    m_frameEdit->setRange(0,0);
    m_frameEdit->setButtonSymbols(QAbstractSpinBox::NoButtons);
    m_frameEdit->setAlignment(Qt::AlignCenter);
    m_frameEdit->setKeyboardTracking(false);

    connect(m_prevButton, SIGNAL(clicked()), this, SIGNAL(stepBack()));
    connect(m_playButton, SIGNAL(clicked()), this, SLOT(toogle()));
    connect(m_nextButton, SIGNAL(clicked()), this, SIGNAL(stepForward()));

    connect(m_frameSlider, SIGNAL(valueChanged(int)), this, SIGNAL(currentFrameChanged(int)));
    connect(m_frameSlider, SIGNAL(sliderMoved(int)), this, SIGNAL(currentFrameTracked(int)));
    connect(m_frameSlider, SIGNAL(sliderPressed()), this, SLOT(handleSliderPressed()));
    connect(m_frameSlider, SIGNAL(sliderReleased()), this, SLOT(handleSliderReleased()));

    connect(m_frameEdit, SIGNAL(valueChanged(int)), this, SIGNAL(currentFrameChanged(int)));
}