• 大小: 3.09MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-11
  • 语言: 其他
  • 标签: Qt  VLC  流媒体  播放器  

资源简介

流媒体播放器(接收音频广播、电视直播)。基于Qt+LibVLC编写,压缩包内是项目文件夹和LibVLC的SDK。

资源截图

代码片段和文件信息

#include “fulldialog.h“
#include “ui_fulldialog.h“
#include 

fullDialog::fullDialog(QWidget *parent) :
    QDialog(parent)
    ui(new Ui::fullDialog)
{
    ui->setupUi(this);

    ui->ctrlWidget->setMouseTracking(true);
    ui->ctrlWidget->installEventFilter(this);
    ui->disWidget->setAttribute(Qt::WA_TransparentForMouseEvents);

    isHide = true;
    ctrlHeight = 60;
    fWidth = QApplication::desktop()->width();
    fHeight = QApplication::desktop()->height();

    //根据屏幕大小设置控件位置。
    this->resize(QApplication::desktop()->size());

    ui->disWidget->setGeometry(00 fWidth fHeight);
    ui->ctrlWidget->setGeometry(0fHeight-1 fWidthctrlHeight);

    //设置浮动条中的控件布局。
    int objectY = (ui->ctrlWidget->height()-ui->lastButton->height()) / 2;
    int objectW = ui->lastButton->width();
    int space = (this->width() - objectW*5) / 15;
    ui->lastButton->move(space*5 objectY);
    ui->pauseButton->move(space*6+objectW objectY);
    ui->playButton->move(ui->pauseButton->pos());
    ui->nextButton->move(space*7+objectW*2 objectY);
    ui->refreshButton->move(space*9+objectW*3 objectY);
    ui->fullButton->move(space*10+objectW*4 objectY);

    /********信号与槽********/
    //上个电台
    connect(ui->lastButton SIGNAL(clicked(bool)) this SIGNAL(lastStation()));
    connect(ui->lastButton SIGNAL(clicked(bool)) this SLOT(showPause()));
    //暂停
    connect(ui->pauseButton SIGNAL(clicked(bool)) this SIGNAL(pause()));
    connect(ui->pauseButton SIGNAL(clicked(bool)) this SLOT(showPlay()));
    //播放
    connect(ui->playButton SIGNAL(clicked(bool)) this SIGNAL(play()));
    connect(ui->playButton SIGNAL(clicked(bool)) this SLOT(showPause()));
    //下个电台
    connect(ui->nextButton SIGNAL(clicked(bool)) this SIGNAL(nextStation()));
    connect(ui->nextButton SIGNAL(clicked(bool)) this SLOT(showPause()));
    //刷新
    connect(ui->refreshButton SIGNAL(clicked(bool)) this SIGNAL(refreshStation()));
    connect(ui->refreshButton SIGNAL(clicked(bool)) this SLOT(showPause()));
    //退出全屏
    connect(ui->fullButton SIGNAL(clicked(bool)) SIGNAL(normalScreen()));
}

fullDialog::~fullDialog()
{
    delete ui;
}

WId fullDialog::getWinID()
{
    return ui->disWidget->winId();
}

void fullDialog::setPlaying(bool playing)
{
    if (playing)
        this->showPause();
    else
        this->showPlay();
}

bool fullDialog::getPlaying()
{
    if (ui->playButton->isHidden())
        return true;
    else
        return false;
}

bool fullDialog::eventFilter(Qobject *target QEvent *event)
{
    if (event->type() == QEvent::MouseMove)
    {
        QMouseEvent *mousevent = static_cast(event);
        if (isHide)
        {      
            QPropertyAnimation *animation = new QPropertyAnimation(ui->ctrlWidget “pos“);
            animation->setDuration(200);
            animation->setStartValue(ui->ctrlWidget->pos());
         

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-06-07 15:47  sdk\
     目录           0  2016-06-07 15:47  sdk\include\
     目录           0  2016-06-07 15:47  sdk\include\vlc\
     文件        2449  2016-01-21 07:57  sdk\include\vlc\deprecated.h
     文件       20620  2016-01-21 07:57  sdk\include\vlc\libvlc.h
     文件        6701  2016-01-21 07:57  sdk\include\vlc\libvlc_events.h
     文件       18189  2016-01-21 07:57  sdk\include\vlc\libvlc_media.h
     文件        3687  2016-01-21 07:57  sdk\include\vlc\libvlc_media_discoverer.h
     文件        2982  2016-01-21 07:57  sdk\include\vlc\libvlc_media_library.h
     文件        6554  2016-01-21 07:57  sdk\include\vlc\libvlc_media_list.h
     文件        6717  2016-01-21 07:57  sdk\include\vlc\libvlc_media_list_player.h
     文件       63694  2016-01-21 07:57  sdk\include\vlc\libvlc_media_player.h
     文件        2093  2016-01-21 07:57  sdk\include\vlc\libvlc_structures.h
     文件        2147  2016-01-21 07:57  sdk\include\vlc\libvlc_version.h
     文件       12560  2016-01-21 07:57  sdk\include\vlc\libvlc_vlm.h
     目录           0  2016-06-07 15:47  sdk\include\vlc\plugins\
     文件       46113  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_about.h
     文件        6288  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_access.h
     文件        5821  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_addons.h
     文件       13754  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_aout.h
     文件        1719  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_aout_volume.h
     文件       22492  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_arrays.h
     文件       14719  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_atomic.h
     文件        1318  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_avcodec.h
     文件        4679  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_bits.h
     文件       11714  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_block.h
     文件       13904  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_block_helper.h
     文件        5976  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_charset.h
     文件        8609  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_codec.h
     文件       26291  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_common.h
     文件        4504  2016-01-21 07:57  sdk\include\vlc\plugins\vlc_config.h
............此处省略218个文件信息

评论

共有 条评论