• 40256阅读
  • 52回复

基于Qt phonon 实现的跨平台播放器,支持KTV歌词显示 [复制链接]

上一主题 下一主题
离线weittdd
 

只看楼主 倒序阅读 楼主  发表于: 2009-06-01
基于Qt phonon 实现的跨平台播放器,支持KTV歌词显示
— 本帖被 XChinux 执行加亮操作(2009-12-18) —
我的毕业论文项目,事实上还有许多功能等待实现,开源作品:
可以在http://code.google.com/p/lingouplayer/ 查看具体内容

QT phonon base player, use mplayer as it backend,like winamp or ttplayer or kugou

Lingou:



播放器特色:


当前实现功能:





KTV歌词效果:


全局效果图:


离线xzilla

只看该作者 1楼 发表于: 2009-06-01
厉害~!顶起
离线gvim
只看该作者 2楼 发表于: 2009-06-01
顶起,高手啊。
Qt,Qt! 分享Cute之Qt体验
欢迎访问 http://www.cuteqt.com
欢迎订阅 http://www.cuteqt.com/?feed=rss2

离线lbf120
只看该作者 3楼 发表于: 2009-06-03
高手啊
离线haulm

只看该作者 4楼 发表于: 2009-06-04
make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -
DQT_PHONON_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_
SHARED -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/lib/qt4/i
nclude/QtCore -I/usr/lib/qt4/include/QtGui -I/usr/lib/qt4/in
clude/QtXml -I/usr/lib/qt4/include/phonon -I/usr/lib/qt4/inc
lude -I. -IG:\wtd\lib\v2.0\v2.0.include -IG:\wtd\lib\taglib-
1.5-mingw-bin\include\taglib -I. -I. -o SoundCore.o SoundCor
e.cpp
在包含自 SoundCore.cpp:1 的文件中:
SoundCore.h:5:18: 错误:Phonon:没有那个文件或目录
在包含自 SoundCore.h:11 的文件中,
                 从 SoundCore.cpp:1:
Log.h:9:36: 错误:WLog/WLogInterface.h:没有那个文件或目录
SoundCore.cpp:3:30: 错误:Phonon/AudioOutput:没有那个文件或
目录
SoundCore.cpp:4:38: 错误:Phonon/BackendCapabilities:没有那
个文件或目录
SoundCore.cpp:5:30: 错误:Phonon/MediaObject:没有那个文件或
目录
SoundCore.cpp:6:30: 错误:Phonon/VideoWidget:没有那个文件或
目录
SoundCore.cpp:7:23: 错误:Phonon/Path:没有那个文件或目录
In file included from SoundCore.cpp:1:
SoundCore.h:14: 错误:expected class-name before ‘{’ token
SoundCore.h:15: 错误:ISO C++ 不允许声明无类型的‘Q_OBJECT’
SoundCore.h:17: 错误:expected ‘;’ before ‘private’
SoundCore.h:32: 错误:‘Phonon’未声明
SoundCore.h:32: 错误:ISO C++ 不允许声明无类型的‘MediaObject

SoundCore.h:32: 错误:expected ‘;’ before ‘*’ token
SoundCore.h:33: 错误:‘Phonon’未声明
SoundCore.h:33: 错误:ISO C++ 不允许声明无类型的‘AudioOutput

SoundCore.h:33: 错误:expected ‘;’ before ‘*’ token
SoundCore.h:35: 错误:‘qint64’没有命名一个类型
SoundCore.h:36: 错误:‘qint64’没有命名一个类型
SoundCore.h:44: 错误:expected primary-expression before ‘vo
id’
SoundCore.h:44: 错误:ISO C++ 不允许声明无类型的‘signals’
SoundCore.h:44: 错误:expected ‘;’ before ‘void’
SoundCore.h:52: 错误:ISO C++ 不允许声明无类型的‘QString’
SoundCore.h:52: 错误:expected ‘,’ or ‘...’ before ‘&’ token
SoundCore.h:53: 错误:‘qint64’未声明
SoundCore.h:55: 错误:expected ‘:’ before ‘slots’
SoundCore.h:56: 错误:expected primary-expression before ‘vo
id’
SoundCore.h:56: 错误:ISO C++ 不允许声明无类型的‘slots’
SoundCore.h:56: 错误:expected ‘;’ before ‘void’
SoundCore.h:60: 错误:‘qint64’未声明
SoundCore.h:62: 错误:‘qreal’未声明
SoundCore.h:64: 错误:ISO C++ 不允许声明无类型的‘QString’
SoundCore.h:64: 错误:expected ‘,’ or ‘...’ before ‘strUrl’
SoundCore.h:65: 错误:ISO C++ 不允许声明无类型的‘QString’
SoundCore.h:65: 错误:expected ‘,’ or ‘...’ before ‘strUrl’
SoundCore.h:66: 错误:‘qint64’未声明
SoundCore.h:67: 错误:expected ‘:’ before ‘slots’
SoundCore.h:68: 错误:expected primary-expression before ‘vo
id’
SoundCore.h:68: 错误:ISO C++ 不允许声明无类型的‘slots’
SoundCore.h:68: 错误:expected ‘;’ before ‘void’
SoundCore.h:71: 错误:‘Phonon’未声明
SoundCore.h:71: 错误:ISO C++ 不允许声明无类型的‘MediaObject

SoundCore.h:71: 错误:expected ‘;’ before ‘*’ token
SoundCore.h:72: 错误:‘Phonon’未声明
SoundCore.h:72: 错误:ISO C++ 不允许声明无类型的‘AudioOutput

SoundCore.h:72: 错误:expected ‘;’ before ‘*’ token
SoundCore.h:73: 错误:‘Phonon’未声明
SoundCore.h:73: 错误:ISO C++ 不允许声明无类型的‘Path’
SoundCore.h:73: 错误:expected ‘;’ before ‘m_audioOutPath’
SoundCore.cpp:12: 错误:隐式声明的‘SoundCore::SoundCore()’的
定义
SoundCore.cpp:44: 错误:‘Phonon’未声明
SoundCore.cpp:44: 错误:expected constructor, destructor, or
type conversion before ‘*’ token
SoundCore.cpp:49: 错误:‘Phonon’未声明
SoundCore.cpp:49: 错误:expected constructor, destructor, or
type conversion before ‘*’ token
SoundCore.cpp:54: 错误:‘qint64’没有命名一个类型
SoundCore.cpp:59: 错误:‘qint64’没有命名一个类型
SoundCore.cpp: In member function ‘bool SoundCore::isMuted()
’:
SoundCore.cpp:66: 错误:‘m_pAudioOut’在此作用域中尚未声明
SoundCore.cpp: At global scope:
SoundCore.cpp:69: 错误:变量或字段‘seek’声明为 void
SoundCore.cpp:69: 错误:‘qint64’在此作用域中尚未声明
SoundCore.cpp: In member function ‘bool SoundCore::isPlaying
()’:
SoundCore.cpp:77: 错误:‘class SoundCore’没有名为‘m_pMediaOb
ject’的成员
SoundCore.cpp:77: 错误:‘Phonon’未声明
SoundCore.cpp: In member function ‘bool SoundCore::isPause()
’:
SoundCore.cpp:81: 错误:‘class SoundCore’没有名为‘m_pMediaOb
ject’的成员
SoundCore.cpp:81: 错误:‘Phonon’未声明
SoundCore.cpp: In member function ‘bool SoundCore::isStop()’
:
SoundCore.cpp:85: 错误:‘class SoundCore’没有名为‘m_pMediaOb
ject’的成员
SoundCore.cpp:85: 错误:‘Phonon’未声明
SoundCore.cpp: In member function ‘void SoundCore::setMuted(
)’:
SoundCore.cpp:90: 错误:‘m_pAudioOut’在此作用域中尚未声明
SoundCore.cpp: At global scope:
SoundCore.cpp:93: 错误:变量或字段‘setVolume’声明为 void
SoundCore.cpp:93: 错误:‘qreal’在此作用域中尚未声明
SoundCore.cpp:98: 错误:变量或字段‘test’声明为 void
SoundCore.cpp:98: 错误:‘qint64’在此作用域中尚未声明
SoundCore.cpp:104: 错误:成员函数‘void SoundCore::play()’未
在类‘SoundCore’中声明
SoundCore.cpp: In member function ‘void SoundCore::pause()’:
SoundCore.cpp:118: 错误:‘class SoundCore’没有名为‘m_pMediaO
bject’的成员
SoundCore.cpp: In member function ‘void SoundCore::stop()’:
SoundCore.cpp:123: 错误:‘class SoundCore’没有名为‘m_pMediaO
bject’的成员
SoundCore.cpp: In member function ‘void SoundCore::clearQueu
e()’:
SoundCore.cpp:128: 错误:‘class SoundCore’没有名为‘m_pMediaO
bject’的成员
SoundCore.cpp: At global scope:
SoundCore.cpp:131: 错误:ISO C++ 不允许声明无类型的‘QString’
SoundCore.cpp:131: 错误:expected ‘,’ or ‘...’ before ‘strUr
l’
SoundCore.cpp: In member function ‘void SoundCore::changeUrl
To(int)’:
SoundCore.cpp:135: 错误:‘class SoundCore’没有名为‘m_pMediaO
bject’的成员
SoundCore.cpp:135: 错误:‘Phonon’未声明
SoundCore.cpp:135: 错误:‘strUrl’在此作用域中尚未声明
SoundCore.cpp:136: 错误:‘emit’在此作用域中尚未声明
SoundCore.cpp:136: 错误:expected ‘;’ before ‘startPlay’
SoundCore.cpp:138: 错误:‘class SoundCore’没有名为‘play’的成       员
SoundCore.cpp: At global scope:
SoundCore.cpp:131: 警告:未使用的参数‘QString’
SoundCore.cpp:141: 错误:ISO C++ 不允许声明无类型的‘QString’
SoundCore.cpp:141: 错误:expected ‘,’ or ‘...’ before ‘strUr       l’
SoundCore.cpp: In member function ‘void SoundCore::pushUrl2Q       ueue(int)’:
SoundCore.cpp:143: 错误:‘class SoundCore’没有名为‘m_pMediaO       bject’的成员
SoundCore.cpp:143: 错误:‘Phonon’未声明
SoundCore.cpp:143: 错误:‘strUrl’在此作用域中尚未声明
SoundCore.cpp: At global scope:
SoundCore.cpp:141: 警告:未使用的参数‘QString’
SoundCore.cpp:146: 错误:变量或字段‘stateChanged’声明为 void
SoundCore.cpp:146: 错误:‘Phonon’未声明
SoundCore.cpp:146: 错误:‘Phonon’未声明
make: *** [SoundCore.o] 错误 1
离线haulm

只看该作者 5楼 发表于: 2009-06-04
rpm -qa|grep phonon
qt4-phonon-gstreamer-4.5.1-1mgc.i686
qt4-phonon-devel-4.5.1-1mgc.i686
qt4-phonon-4.5.1-1mgc.i686

兄台没有在linux下测试过
离线平常道
只看该作者 6楼 发表于: 2009-06-04
不过不错,楼主要多来给大家普及点phonon的知识啊
离线平常道
只看该作者 7楼 发表于: 2009-06-04
下载下来稍用了下,发现了一些小问题
1. 打开文件的那个按钮太隐蔽了吧,我开始一片茫然,不知道怎么打开文件。建议添加右键菜单,音频文件拖拽。
2. 歌词显示的关闭似乎有问题,关闭了后,下一句歌词就又打开了

正在使用中
离线feiying888

只看该作者 8楼 发表于: 2009-06-04
编译后,出现如下错误,请楼主帮忙
离线weittdd

只看该作者 9楼 发表于: 2009-06-04
   有兄弟使用小弟的cuo软件,在此感谢大家!

其实和5所说的相同,我没有在linux下测试过


原因:
自己的电脑送回家了,现在用的别人的电脑,所以不好在人家电脑上安装一个linux,如果安装在虚拟机里面的话性能很不好,慢到不能忍,所以我说是跨平台,其实自己只知道我没有用平台相关的代码而已。如果哪位兄弟有心情可以帮助修改一下:

三个库:
Lingou使用了三个库,一个是Qt4.5,一个是taglib,一个是wlog
1. Qt4.5
没什么好说的,基本上在这里看贴的不会不知道怎么安装,怎么使用。
2. Taglib
此软件是一个可跨平台的一个标签提取软件,可以在kde的开发主页面上找到,具体网址http://developer.kde.org/~wheeler/taglib.html,取得taglib的连接库后修改core/core.proINCLUDEPATH 下的"G:\lib\taglib-1.5-mingw-bin\include\taglib"修改为你的taglibinclude目录,并将LIBS下的-L"G:\lib\taglib-1.5-mingw-bin\lib" 修改为你的taglib连接库所在目录。
3. Wlog
这是一个我自已为了写这个lingou播放器而写的一个小项目,专门作日志操作的,可以在 http://code.google.com/p/jelog/找到相关代码,不过你完全可以不用这个日志库,见源码下:core/Log.h 里面。
方法1:不要用wlog这个库
其中有这样一句话:
#ifndef USE_LIBARY_WLOG
    #define USE_LIBARY_WLOG 1
#endif
你可以把它修改成:
#ifndef USE_LIBARY_WLOG
    #define USE_LIBARY_WLOG 0
#endif
或直接删除这个定义,这样就不会include wlog了。
然后删除core/core.proui/ui.pro里的相关includelibs项:
INCLUDEPATH 下:"G:\lib\v2.0\v2.0.include" \
LIBS 下: -L"G:\lib\v2.0\v2.0.lib" \    -lwlog\
方法2:使用wlog这个库,也称jelog
如果不去除的话,大家都明白,在http://code.google.com/p/jelog/下载jelog进行编译,然后修改core/core.proui/ui.pro下的相关includelibs项:
INCLUDEPATH 下:"G:\lib\v2.0\v2.0.include" \
LIBS 下: -L"G:\lib\v2.0\v2.0.lib" \    -lwlog\
为你放置wlog的引用目录与库目录。如果你按这样做了,还不行,那么估计是在ui/main.cpp使用了两个wlog里面的函数,理论上不会不行,jeloglinux版本是我自己测试过的,没有问题,生成动态连接库使用make so静态的make a如果是测试程序可以试试make love

如果你编译了linux下的版本还有问题,那实再真的很对不起,只能自己查找原因,说实话,我写这个代码并不好,因为开发很快,前后一个星期来写代码,代码量不大,5-6千行,分两个工程。
个人觉得比较有意思的部分有二:
1. 皮肤配置文件,大家可以看看SkinLoader.hLGSkinLoader.h,然后是UiBuilder::reloadSkin() ,使用的是xml+qss
2. KTV歌词显示,先解析lrc歌词然后在不同的时间画不同进度的结果图,使用两图迭加。
具体可以见文件LyricParser.hlyricmanager.h然后是显示在View.hLyricLine.h


再告诉大家一点事:关于Qt phonon的使用!
http://code.google.com/p/lingouplayer/source/browse/#svn/trunk/artical下面有文章介绍了在Qt开源版里面如何使用phonon,使用mplayer作后端。

其次就是在:http://code.google.com/p/lingouplayer/source/browse/#svn/trunk/src 这个目录下面是我之前从qmmp里面提取出来的winamp2皮肤实现代码,后来没有用了

目录比较乱,因为换了好几次目录。

如果很多人有兴趣,我会找时间重新设计一下,发布一个winlinux下都可以使用而不用费神的源码,谢谢各位大哥大姐小弟小妹的支持。
[ 此帖被weittdd在2009-06-04 23:51重新编辑 ]
离线weittdd

只看该作者 10楼 发表于: 2009-06-04
引用第7楼平常道于2009-06-04 10:44发表的  :
下载下来稍用了下,发现了一些小问题
1. 打开文件的那个按钮太隐蔽了吧,我开始一片茫然,不知道怎么打开文件。建议添加右键菜单,音频文件拖拽。
2. 歌词显示的关闭似乎有问题,关闭了后,下一句歌词就又打开了
正在使用中

1. 这个问题我也发现了,呵呵,因为原来是准备变成kugou那样的,后来导师时间催的很紧就没有添加那个打开文件夹与打开文件等的菜单了,单这个功能我记得实际上已经在Connector里面实现了,没有写界面,不好意思!
2. 是的,关闭显示有问题,这功能原来是对的,后来我修改一个bug又引发了

还有一个问题,,,,向后倒退里歌词不能显示了,,向前可以,,,这个是因为在查找结点那里我是从当前向后查找的。。可以修改成从0开始。

谢谢你的建议!
离线dongfanglu

只看该作者 11楼 发表于: 2009-06-09
出现如下问题,系统archlinux + kde
在包含自 SoundCore.cpp:1 的文件中:                                                                                                          
SoundCore.h:5:18: 错误:Phonon:没有那个文件或目录                                                                                            
SoundCore.cpp:3:30: 错误:Phonon/AudioOutput:没有那个文件或目录                                                                              
SoundCore.cpp:4:38: 错误:Phonon/BackendCapabilities:没有那个文件或目录                                                                      
SoundCore.cpp:5:30: 错误:Phonon/MediaObject:没有那个文件或目录                                                                              
SoundCore.cpp:6:30: 错误:Phonon/VideoWidget:没有那个文件或目录                                                                              
SoundCore.cpp:7:23: 错误:Phonon/Path:没有那个文件或目录                                                                                    
In file included from SoundCore.cpp:1:                                                                                                        
SoundCore.h:14: 错误:expected class-name before ‘{’ token                                                                                    
SoundCore.h:15: 错误:ISO C++ 不允许声明无类型的‘Q_OBJECT’                                                                                    
SoundCore.h:17: 错误:expected ‘;’ before ‘private’                                                                                          
SoundCore.h:32: 错误:‘Phonon’未声明                                                                                                          
SoundCore.h:32: 错误:ISO C++ 不允许声明无类型的‘MediaObject’                                                                                
SoundCore.h:32: 错误:expected ‘;’ before ‘*’ token                                                                                          
SoundCore.h:33: 错误:‘Phonon’未声明                                                                                                          
SoundCore.h:33: 错误:ISO C++ 不允许声明无类型的‘AudioOutput’                                                                                
SoundCore.h:33: 错误:expected ‘;’ before ‘*’ token                                                                                          
SoundCore.h:35: 错误:‘qint64’没有命名一个类型                                                                                                
SoundCore.h:36: 错误:‘qint64’没有命名一个类型                                                                                                
SoundCore.h:44: 错误:expected primary-expression before ‘void’                                                                              
SoundCore.h:44: 错误:ISO C++ 不允许声明无类型的‘signals’                                                                                    
SoundCore.h:44: 错误:expected ‘;’ before ‘void’                                                                                              
SoundCore.h:52: 错误:expected ‘,’ or ‘...’ before ‘&’ token                                                                                  
SoundCore.h:52: 错误:ISO C++ 不允许声明无类型的‘QString’                                                                                    
SoundCore.h:53: 错误:‘qint64’未声明                                                                                                          
SoundCore.h:55: 错误:expected `:' before ‘slots’                                                                                            
SoundCore.h:56: 错误:expected primary-expression before ‘void’                                                                              
SoundCore.h:56: 错误:ISO C++ 不允许声明无类型的‘slots’                                                                                      
SoundCore.h:56: 错误:expected ‘;’ before ‘void’                                                                                              
SoundCore.h:60: 错误:‘qint64’未声明                                                                                                          
SoundCore.h:62: 错误:‘qreal’未声明                                                                                                          
SoundCore.h:64: 错误:expected ‘,’ or ‘...’ before ‘strUrl’                                                                                  
SoundCore.h:64: 错误:ISO C++ 不允许声明无类型的‘QString’                                                                                    
SoundCore.h:65: 错误:expected ‘,’ or ‘...’ before ‘strUrl’                                                                                  
SoundCore.h:65: 错误:ISO C++ 不允许声明无类型的‘QString’                                                                                    
SoundCore.h:66: 错误:expected ‘,’ or ‘...’ before ‘strUrl’                                                                                  
SoundCore.h:66: 错误:ISO C++ 不允许声明无类型的‘QString’                                                                                    
SoundCore.h:67: 错误:‘qint64’未声明                                                                                                          
SoundCore.h:68: 错误:expected `:' before ‘slots’                                                                                            
SoundCore.h:69: 错误:expected primary-expression before ‘void’                                                                              
SoundCore.h:69: 错误:ISO C++ 不允许声明无类型的‘slots’                                                                                      
SoundCore.h:69: 错误:expected ‘;’ before ‘void’                                                                                              
SoundCore.h:72: 错误:‘Phonon’未声明                                                                                                          
SoundCore.h:72: 错误:ISO C++ 不允许声明无类型的‘MediaObject’                                                                                
SoundCore.h:72: 错误:expected ‘;’ before ‘*’ token                                                                                          
SoundCore.h:73: 错误:‘Phonon’未声明                                                                                                          
SoundCore.h:73: 错误:ISO C++ 不允许声明无类型的‘AudioOutput’                                                                                
SoundCore.h:73: 错误:expected ‘;’ before ‘*’ token                                                                                          
SoundCore.h:74: 错误:‘Phonon’未声明                                                                                                          
SoundCore.h:74: 错误:ISO C++ 不允许声明无类型的‘Path’                                                                                        
SoundCore.h:74: 错误:expected ‘;’ before ‘m_audioOutPath’                                                                                    
SoundCore.cpp:12: 错误:隐式声明的‘SoundCore::SoundCore()’的定义                                                                              
SoundCore.cpp:44: 错误:‘Phonon’未声明                                                                                                        
SoundCore.cpp:44: 错误:expected constructor, destructor, or type conversion before ‘*’ token                                                
SoundCore.cpp:49: 错误:‘Phonon’未声明                                                                                                        
SoundCore.cpp:49: 错误:expected constructor, destructor, or type conversion before ‘*’ token                                                
SoundCore.cpp:54: 错误:‘qint64’没有命名一个类型                                                                                              
SoundCore.cpp:59: 错误:‘qint64’没有命名一个类型                                                                                              
SoundCore.cpp: In member function ‘bool SoundCore::isMuted()’:                                                                                
SoundCore.cpp:66: 错误:‘m_pAudioOut’在此作用域中尚未声明                                                                                    
SoundCore.cpp: At global scope:                                                                                                              
SoundCore.cpp:69: 错误:变量或字段‘seek’声明为 void                                                                                          
SoundCore.cpp:69: 错误:‘qint64’在此作用域中尚未声明                                                                                          
SoundCore.cpp: In member function ‘bool SoundCore::isPlaying()’:                                                                              
SoundCore.cpp:77: 错误:‘class SoundCore’没有名为‘m_pMediaObject’的成员                                                                      
SoundCore.cpp:77: 错误:‘Phonon’未声明                                                                                                        
SoundCore.cpp: In member function ‘bool SoundCore::isPause()’:                                                                                
SoundCore.cpp:81: 错误:‘class SoundCore’没有名为‘m_pMediaObject’的成员                                                                      
SoundCore.cpp:81: 错误:‘Phonon’未声明                                                                                                        
SoundCore.cpp: In member function ‘bool SoundCore::isStop()’:                                                                                
SoundCore.cpp:85: 错误:‘class SoundCore’没有名为‘m_pMediaObject’的成员                                                                      
SoundCore.cpp:85: 错误:‘Phonon’未声明                                                                                                        
SoundCore.cpp: In member function ‘void SoundCore::setMuted()’:                                                                              
SoundCore.cpp:90: 错误:‘m_pAudioOut’在此作用域中尚未声明                                                                                    
SoundCore.cpp: At global scope:                                                                                                              
SoundCore.cpp:93: 错误:变量或字段‘setVolume’声明为 void                                                                                      
SoundCore.cpp:93: 错误:‘qreal’在此作用域中尚未声明                                                                                          
SoundCore.cpp:98: 错误:变量或字段‘test’声明为 void                                                                                          
SoundCore.cpp:98: 错误:‘qint64’在此作用域中尚未声明                                                                                          
SoundCore.cpp:104: 错误:成员函数‘void SoundCore::play()’未在类‘SoundCore’中声明                                                              
SoundCore.cpp: In member function ‘void SoundCore::pause()’:                                                                                  
SoundCore.cpp:118: 错误:‘class SoundCore’没有名为‘m_pMediaObject’的成员                                                                      
SoundCore.cpp: In member function ‘void SoundCore::stop()’:                                                                                  
SoundCore.cpp:123: 错误:‘class SoundCore’没有名为‘m_pMediaObject’的成员                                                                      
SoundCore.cpp: In member function ‘void SoundCore::clearQueue()’:                                                                            
SoundCore.cpp:128: 错误:‘class SoundCore’没有名为‘m_pMediaObject’的成员                                                                      
SoundCore.cpp: At global scope:                                                                                                              
SoundCore.cpp:131: 错误:expected ‘,’ or ‘...’ before ‘strUrl’                                                                                
SoundCore.cpp:131: 错误:ISO C++ 不允许声明无类型的‘QString’                                                                                  
SoundCore.cpp: In member function ‘void SoundCore::changeUrlTo(int)’:                                                                        
SoundCore.cpp:135: 错误:‘class SoundCore’没有名为‘m_pMediaObject’的成员                                                                      
SoundCore.cpp:135: 错误:‘Phonon’未声明                                                                                                      
SoundCore.cpp:135: 错误:‘strUrl’在此作用域中尚未声明                                                                                        
SoundCore.cpp:136: 错误:‘emit’在此作用域中尚未声明                                                                                          
SoundCore.cpp:136: 错误:expected `;' before ‘startPlay’                                                                                      
SoundCore.cpp:138: 错误:‘class SoundCore’没有名为‘play’的成员                                                                                
SoundCore.cpp: At global scope:                                                                                                              
SoundCore.cpp:131: 警告:未使用的参数‘QString’                                                                                                
SoundCore.cpp:140: 错误:expected ‘,’ or ‘...’ before ‘strUrl’                                                                                
SoundCore.cpp:140: 错误:ISO C++ 不允许声明无类型的‘QString’                                                                                  
SoundCore.cpp: In member function ‘void SoundCore::setCurUrl(int)’:                                                                          
SoundCore.cpp:143: 错误:‘class SoundCore’没有名为‘m_pMediaObject’的成员                                                                      
SoundCore.cpp:143: 错误:‘Phonon’未声明                                                                                                      
SoundCore.cpp:143: 错误:‘strUrl’在此作用域中尚未声明                                                                                        
SoundCore.cpp: At global scope:                                                                                                              
SoundCore.cpp:140: 警告:未使用的参数‘QString’                                                                                                
SoundCore.cpp:146: 错误:expected ‘,’ or ‘...’ before ‘strUrl’                                                                                
SoundCore.cpp:146: 错误:ISO C++ 不允许声明无类型的‘QString’                                                                                  
SoundCore.cpp: In member function ‘void SoundCore::pushUrl2Queue(int)’:                                                                      
SoundCore.cpp:148: 错误:‘class SoundCore’没有名为‘m_pMediaObject’的成员
SoundCore.cpp:148: 错误:‘Phonon’未声明
SoundCore.cpp:148: 错误:‘strUrl’在此作用域中尚未声明
SoundCore.cpp: At global scope:
SoundCore.cpp:146: 警告:未使用的参数‘QString’
SoundCore.cpp:151: 错误:变量或字段‘stateChanged’声明为 void
SoundCore.cpp:151: 错误:‘Phonon’未声明
SoundCore.cpp:151: 错误:‘Phonon’未声明
make: *** [SoundCore.o] 错误 1
离线weittdd

只看该作者 12楼 发表于: 2009-06-15
引用第11楼dongfanglu于2009-06-09 19:38发表的  :
出现如下问题,系统archlinux + kde
在包含自 SoundCore.cpp:1 的文件中:                                                                                                          
SoundCore.h:5:18: 错误:Phonon:没有那个文件或目录                                                                                            
SoundCore.cpp:3:30: 错误:Phonon/AudioOutput:没有那个文件或目录                                                                              
SoundCore.cpp:4:38: 错误:Phonon/BackendCapabilities:没有那个文件或目录                                                                      
.......


你这个错误很显然是没有编译过phonon插件
离线haulm

只看该作者 13楼 发表于: 2009-06-16
不是没编译过phonon,而是在大小写方面有出入,Qt 在函数声明时要大写,而在库声明时要小写,win当然是无视大小写的。
离线haulm

只看该作者 14楼 发表于: 2009-06-16
Qt 4.5.1 有些变化,不能直接在widget上画上图片,不能给label上放图片(显示不出来),真的不少东西会让初学者感到困惑。
离线3314175

只看该作者 15楼 发表于: 2009-06-20
这位学长真是太棒了,我也想做一个类似的东西,视频方面的,但是不知道如何用类似mplayer的内核做后台处理,如果有相关学习连接,请给一个,谢谢大哥了
离线gnix

只看该作者 16楼 发表于: 2009-07-15
很实用的项目,顶起来
离线luohai83

只看该作者 17楼 发表于: 2009-11-18
好几年后...我又找到了...想不到就在这里...支持支持 ...梦里寻她千百度 蓦然回首 高手却把代码放在这里...小弟正在学习学习...
离线dinggb
只看该作者 18楼 发表于: 2009-12-09
ding
离线qujunde

只看该作者 19楼 发表于: 2009-12-09
编译总是不成功 郁闷
[ 此帖被qujunde在2009-12-14 02:50重新编辑 ]
离线x000zhiwei
只看该作者 20楼 发表于: 2009-12-18
厉害啊!
离线tears1134

只看该作者 21楼 发表于: 2009-12-30
牛人!
楼主发布的源码是不是少了一个头文件:lrcloader.h
明天会更好!
离线long2015

只看该作者 22楼 发表于: 2010-01-11
研究学习下,lz图片怎么不显示?
离线badmanld
只看该作者 23楼 发表于: 2010-01-13
楼主有没有文档啊?也借我用用啊!邮箱:badmanld@hotmail.com  谢谢啊!我也是做毕业设计的。
离线x000zhiwei
只看该作者 24楼 发表于: 2010-01-16
谢谢分享!
离线yanzhaozhizi
只看该作者 25楼 发表于: 2010-01-27
谢谢  看看
离线hu851217

只看该作者 26楼 发表于: 2010-07-14
 高手,顶起!!!!!!!!!!!
离线beaujolais
只看该作者 27楼 发表于: 2010-07-17

core工程编译OK,UI编译也是过的,但是UI的最后一步有个问题,貌似是找不到库,我已经将core工程生成的core.dll和libcore.a分别复制到UI工程的release和当前目录下了。

如下:

release/main.o:main.cpp:(.text+0x2c): undefined reference to `Config::instance()'
release/main.o:main.cpp:(.text+0x3b): undefined reference to `Config::currentSkinPath() const'
release/main.o:main.cpp:(.text+0x5e): undefined reference to `LGSkinLoader::LGSkinLoader(QString const&, QObject*)'
release/main.o:main.cpp:(.text+0xae): undefined reference to `PlayListModel::PlayListModel(QString const&)'
release/main.o:main.cpp:(.text+0x128): undefined reference to `vtable for PlayListModel'
release/main.o:main.cpp:(.text+0x2b1): undefined reference to `vtable for PlayListModel'
release/uibuilder.o:uibuilder.cpp:(.text+0x308): undefined reference to `SkinLoader::getAttr(SkinLoader::ComponentID)'
release/uibuilder.o:uibuilder.cpp:(.text+0x321): undefined reference to `ComponentAttr::name()'
release/uibuilder.o:uibuilder.cpp:(.text+0x382): undefined reference to `ComponentAttr::name()'
release/uibuilder.o:uibuilder.cpp:(.text+0x3a9): undefined reference to `ComponentAttr::y()'
release/uibuilder.o:uibuilder.cpp:(.text+0x3b3): undefined reference to `ComponentAttr::x()'
release/uibuilder.o:uibuilder.cpp:(.text+0x3d1): undefined reference to `ComponentAttr::height()'
release/uibuilder.o:uibuilder.cpp:(.text+0x3db): undefined reference to `ComponentAttr::width()'
release/uibuilder.o:uibuilder.cpp:(.text+0x3f9): undefined reference to `ComponentAttr::hasMask()'
release/uibuilder.o:uibuilder.cpp:(.text+0x40c): undefined reference to `ComponentAttr::getMaskPath()'
release/uibuilder.o:uibuilder.cpp:(.text+0x457): undefined reference to `ComponentAttr::needDisable()'
release/uibuilder.o:uibuilder.cpp:(.text+0x474): undefined reference to `ComponentAttr::needHidden()'
release/uibuilder.o:uibuilder.cpp:(.text+0x492): undefined reference to `ComponentAttr::css()'
release/uibuilder.o:uibuilder.cpp:(.text+0x4bc): undefined reference to `ComponentAttr::toolTip()'
release/uibuilder.o:uibuilder.cpp:(.text+0x841): undefined reference to `SkinLoader::getAttr(SkinLoader::ComponentID)'
release/uibuilder.o:uibuilder.cpp:(.text+0x851): undefined reference to `ComponentAttr::needVertical()'
release/uibuilder.o:uibuilder.cpp:(.text+0x1656): undefined reference to `SkinLoader::reload()'
release/uibuilder.o:uibuilder.cpp:(.text+0x1676): undefined reference to `SkinLoader::skinFilePath()'
release/uibuilder.o:uibuilder.cpp:(.text+0x171b): undefined reference to `SkinLoader::getAttr(SkinLoader::ComponentID)'
release/uibuilder.o:uibuilder.cpp:(.text+0x172a): undefined reference to `ComponentAttr::css()'
release/connector.o:connector.cpp:(.text+0x29): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x31): undefined reference to `SoundCore::isMuted()'
release/connector.o:connector.cpp:(.text+0x7d): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x85): undefined reference to `SoundCore::setMuted()'
release/connector.o:connector.cpp:(.text+0x8a): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x92): undefined reference to `SoundCore::isMuted()'
release/connector.o:connector.cpp:(.text+0x99): undefined reference to `Config::instance()'
release/connector.o:connector.cpp:(.text+0xa8): undefined reference to `Config::setMuted(bool) const'
release/connector.o:connector.cpp:(.text+0x113): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x125): undefined reference to `SoundCore::setVolume(double)'
release/connector.o:connector.cpp:(.text+0x12a): undefined reference to `Config::instance()'
release/connector.o:connector.cpp:(.text+0x14b): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x16c): undefined reference to `SoundCore::seek(long long)'
release/connector.o:connector.cpp:(.text+0x17f): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x199): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x1a1): undefined reference to `SoundCore::pause()'
release/connector.o:connector.cpp:(.text+0x249): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x251): undefined reference to `SoundCore::play()'
release/connector.o:connector.cpp:(.text+0x2f8): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x327): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x37a): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x454): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x551): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x594): more undefined references to `SoundCore::instance()' follow
release/connector.o:connector.cpp:(.text+0x784): undefined reference to `Config::instance()'
release/connector.o:connector.cpp:(.text+0x78c): undefined reference to `Config::volume() const'
release/connector.o:connector.cpp:(.text+0x79e): undefined reference to `Config::instance()'
release/connector.o:connector.cpp:(.text+0x7a6): undefined reference to `Config::mute() const'
release/connector.o:connector.cpp:(.text+0x7fc): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x804): undefined reference to `SoundCore::setMuted()'
release/connector.o:connector.cpp:(.text+0x8c8): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x8d0): undefined reference to `SoundCore::totalTime()'
release/connector.o:connector.cpp:(.text+0x932): undefined reference to `PlayListModel::currentTag()'
release/connector.o:connector.cpp:(.text+0x941): undefined reference to `MusicTag::showTitle() const'
release/connector.o:connector.cpp:(.text+0x9aa): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x9b2): undefined reference to `SoundCore::totalTime()'
release/connector.o:connector.cpp:(.text+0x9bd): undefined reference to `SoundCore::instance()'
release/connector.o:connector.cpp:(.text+0x9c5): undefined reference to `SoundCore::currentTime()'
release/connector.o:connector.cpp:(.text+0xdbc): undefined reference to `Config::instance()'
release/connector.o:connector.cpp:(.text+0xdcb): undefined reference to `Config::musicFilters() const'
release/connector.o:connector.cpp:(.text+0xdd1): undefined reference to `Config::instance()'
release/connector.o:connector.cpp:(.text+0xde0): undefined reference to `Config::lastOpenDir() const'
release/connector.o:connector.cpp:(.text+0xe95): undefined reference to `PlayListModel::addFiles(QStringList const&)'
release/connector.o:connector.cpp:(.text+0xedf): undefined reference to `Config::instance()'
release/connector.o:connector.cpp:(.text+0xeeb): undefined reference to `Config::setLastOpenDir(QString const&) const'
release/connector.o:connector.cpp:(.text+0x13a): undefined reference to `Config::setVolume(int) const'
release/connector.o:connector.cpp:(.text+0x188): undefined reference to `SoundCore::stop()'
collect2: ld returned 1 exit status
mingw32-make[1]: Leaving directory `E:/MyStudy/Qt/lingouplayerSVN/src/ui'
mingw32-make: Leaving directory `E:/MyStudy/Qt/lingouplayerSVN/src/ui'
mingw32-make[1]: *** [release\ui.exe] Error 1
mingw32-make: *** [release] Error 2
The process "C:/Qt/qtcreator-2.0.0/mingw/bin/mingw32-make.exe" exited with code %2.
Error while building project ui (target: Desktop)
When executing build step 'Make'


有人遇到这个问题没?编译环境是win xp ,qt creator 2.0
离线cupid8505

只看该作者 28楼 发表于: 2010-07-21
回 27楼(beaujolais) 的帖子
搞了一天,终于可以在linux下面跑了~~~界面是出来了,怎么播放没声音呢?还得研究下~~
离线tootzoe
只看该作者 29楼 发表于: 2010-07-23
花了两个小时, 把该补的库下载编译好, 最后编译成功, 一运行, 只见个界面, 添加歌曲放出没声音....
可能是我新的QT 4.70 版本不能前兼容吧.....
离线lnew0223
只看该作者 30楼 发表于: 2010-12-10
在编译的过程中出现了一些问题。

  从http://developer.kde.org/~wheeler/taglib.html下载taglib,并没有找到taglib的include目录和lib目录,而且也没有找到一个lib文件。编译taglib.pro也编译不过。另外,还有问题是在taglib_export.h中

#ifndef TAGLIB_NO_CONFIG
#include "taglib_config.h"
#endif



taglib_config.h也找不到,不过有个taglib_config.h.in文件

   哪位有相关的lib文件吗?谢谢!请发送到 lnew0223@yahoo.cn
离线lnew0223
只看该作者 31楼 发表于: 2010-12-10
回 29楼(tootzoe) 的帖子
我的也是Qt 4.7.0,没编译过taglib。你是怎么弄的呢?
离线gylmy
只看该作者 32楼 发表于: 2010-12-26
楼主,请问用Phonon播放视频时,应该装上什么插件啊?
离线zhqlike
只看该作者 33楼 发表于: 2010-12-29
怎么下载啊
离线pingco0109
只看该作者 34楼 发表于: 2011-03-02
哥们,看不到源码呢

离线xing176
只看该作者 35楼 发表于: 2011-04-09
链接打不开啊
只看该作者 36楼 发表于: 2011-04-20
很强大啊楼主,我也想有个自己的 播放器。在我的手机上
离线hxing
只看该作者 37楼 发表于: 2011-04-23
链接打不开...
离线bonjovi

只看该作者 38楼 发表于: 2011-05-31
我在用其它的控件控制声音时。audiooutput::setvolume(qreal valume)
其中这个qreal的范围是多少呀。。我那个播放器控件声音时,要么有声音,要么没有声音。。
还控制什么呀,郁闷呀,找了很多,找不到。。
离线weihua2008
只看该作者 39楼 发表于: 2011-06-10
楼主方便的话把源码发送一把,google上访问不到,
我的邮箱shengmei208@163.com
谢谢
快速回复
限100 字节
 
上一个 下一个