自己写 的一个音乐播放器

由本社区发起的开源项目
头像
xc1427
帖子: 276
注册时间: 2008-10-11 4:11
来自: 瑞金无线电学校
联系:

Re: 自己写 的一个音乐播放器(每日多次更新)

#46

帖子 xc1427 » 2009-02-22 1:00

我打算做我毕设,哦,可以。谢谢楼主,太谢谢你了。
You never know if you don't try
shszydml
帖子: 13
注册时间: 2008-11-09 0:21
联系:

Re: 自己写 的一个音乐播放器(每日多次更新)

#47

帖子 shszydml » 2009-02-22 2:34

楼主~有个实在不好意思的问题。。。我装成功了。。。怎么启动程序阿?。。。。。。
头像
jarryson
帖子: 4002
注册时间: 2005-08-14 19:53

Re: 自己写 的一个音乐播放器(每日多次更新)

#48

帖子 jarryson » 2009-02-22 2:41

推荐把配置文件放到$XDG_CONFIG_HOME也就是~/.config目录下,让$HOME下不会那么乱。符合X11的XDG标准

看来肯定包含glib2了,可以使用g_get_user_config_dir(),会返回一个字符串类似/home/user/.config
头像
kissdb
帖子: 578
注册时间: 2008-03-28 10:18
来自: 淮安and徐州

Re: 自己写 的一个音乐播放器(每日多次更新)

#49

帖子 kissdb » 2009-02-22 11:04

windwhinny 写了:
kissdb 写了:我的wav是下载的mp3自己转换的,太大了有35M呢
我问的是问号的问题啊,
专辑名字叫linda的那个不是wav格式的?
把那个发我邮箱里把,我看看怎么回事.
大部分情况都是歌曲信息储存的方式不符合标准格式,比如realplayer都用自己的一套格式储存.所以导致读取错误
我的所有歌曲的标签是使用EX Falso更改的,那个WAV里好像没有没有标签信息,太大了发送不了
不是我不想发,而是根本就是一个mp3用mhWaveEdit1.4.14转换的,没有什么太多的信息
今天下午和一群女的聊天,突然有人说我不是男人。
我火了,我说,你说我不是,我掏出来给你看。
女生都笑了,有一个最牛,说,你掏啊……
于是我就把身份证掏出来了。
头像
windwhinny
帖子: 618
注册时间: 2007-09-26 17:34

Re: 自己写 的一个音乐播放器(每日多次更新)

#50

帖子 windwhinny » 2009-02-22 12:13

xc1427 写了:我打算做我毕设,哦,可以。谢谢楼主,太谢谢你了。
因为我是自学的,代码很零乱,很没规则,有时候我自己都看不懂,保重.....
shszydml 写了:楼主~有个实在不好意思的问题。。。我装成功了。。。怎么启动程序阿?。。。。。。
输入"queplayer"命令就可以启动
jarryson 写了:推荐把配置文件放到$XDG_CONFIG_HOME也就是~/.config目录下,让$HOME下不会那么乱。符合X11的XDG标准

看来肯定包含glib2了,可以使用g_get_user_config_dir(),会返回一个字符串类似/home/user/.config
嗯,以后的版本我会把配置放到~/.config里的
上次由 windwhinny 在 2009-02-22 12:15,总共编辑 1 次。
头像
windwhinny
帖子: 618
注册时间: 2007-09-26 17:34

Re: 自己写 的一个音乐播放器(每日多次更新)

#51

帖子 windwhinny » 2009-02-22 12:15

kissdb 写了:
windwhinny 写了:
kissdb 写了:我的wav是下载的mp3自己转换的,太大了有35M呢
我问的是问号的问题啊,
专辑名字叫linda的那个不是wav格式的?
把那个发我邮箱里把,我看看怎么回事.
大部分情况都是歌曲信息储存的方式不符合标准格式,比如realplayer都用自己的一套格式储存.所以导致读取错误
我的所有歌曲的标签是使用EX Falso更改的,那个WAV里好像没有没有标签信息,太大了发送不了
不是我不想发,而是根本就是一个mp3用mhWaveEdit1.4.14转换的,没有什么太多的信息
那个专辑名字叫linda的也是wav?如果是那样的话,我就无能为力了,因为我在网上只找到读取mp3标签的办法,wav标签占时无法读取......
shszydml
帖子: 13
注册时间: 2008-11-09 0:21
联系:

Re: 自己写 的一个音乐播放器

#52

帖子 shszydml » 2009-02-22 19:41

楼主,用了queplayer,系统说找不到命令~
头像
windwhinny
帖子: 618
注册时间: 2007-09-26 17:34

Re: 自己写 的一个音乐播放器

#53

帖子 windwhinny » 2009-02-22 19:48

shszydml 写了:楼主,用了queplayer,系统说找不到命令~
那就直接运行源代码目录下的那个可执行文件"queplayer"(前提是你需要重新"make"一遍)
头像
be00
帖子: 805
注册时间: 2008-07-28 19:51
来自: 长沙
联系:

Re: 自己写 的一个音乐播放器

#54

帖子 be00 » 2009-02-22 19:57

听歌不喜欢有界面的飘过

代码: 全选

zhanggang@T60:~/bin$ cat mp3.sh 
mplayer -shuffle /media/BAK/kugoo/*  < /dev/null > /dev/null &
还是支持楼主,继续加油。
我的乌斑兔儿:http://zhanggang.net/m/b/b1/ubuntu右键选择在新的窗体打开
右边有一只黄手 ----> 或者注册Dropbox中文版感谢我
lawnet
帖子: 49
注册时间: 2005-12-16 10:59

Re: 自己写 的一个音乐播放器

#55

帖子 lawnet » 2009-03-01 22:29

iotioa 写了:
追疯少年 写了:
windwhinny 写了:
追疯少年 写了:怎么安装呢?
在源代码目录输入"make",然后"./project"就可以运行拉
make的时候就出错了 :em20 :em20

代码: 全选

root@jia-laptop:~# cd /root/桌面/player
root@jia-laptop:~/桌面/player# make
gcc main.c -g -c `pkg-config --cflags gtk+-2.0`
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
main.c:1:20: 错误: gtk/gtk.h:没有该文件或目录
在包含自 main.c:3 的文件中:
eggtrayicon.h:24:25: 错误: gtk/gtkplug.h:没有该文件或目录
eggtrayicon.h:25:22: 错误: gdk/gdkx.h:没有该文件或目录
In file included from main.c:3:
eggtrayicon.h:36: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’
eggtrayicon.h:41: 错误: expected specifier-qualifier-list before ‘GtkPlug’
eggtrayicon.h:56: 错误: expected specifier-qualifier-list before ‘GtkPlugClass’
eggtrayicon.h:59: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘egg_tray_icon_get_type’
eggtrayicon.h:61: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
eggtrayicon.h:63: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘egg_tray_icon_get_orientation’
In file included from /usr/include/stdlib.h:33,
                 from main.c:4:
/usr/lib/gcc/i486-linux-gnu/4.2.4/include/stddef.h:326: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’
In file included from main.c:4:
/usr/include/stdlib.h:782: 错误: expected ‘)’ before ‘*’ token
/usr/include/stdlib.h:786: 错误: expected declaration specifiers or ‘...’ before ‘wchar_t’
/usr/include/stdlib.h:790: 错误: expected ‘)’ before ‘*’ token
/usr/include/stdlib.h:794: 错误: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
main.c:6:17: 错误: xine.h:没有该文件或目录
In file included from main.c:7:
main.h:4: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
main.h:5: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
main.h:7: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
main.h:10: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
In file included from main.c:8:
play.h:10: 错误: expected ‘)’ before ‘*’ token
play.h:12: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
play.h:13: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
play.h:14: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
play.h:15: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
In file included from main.c:9:
picture.h:7: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘picture’
In file included from main.c:10:
window.h:4: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
window.h:16: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
window.h:18: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
window.h:22: 错误: ‘PATH_MAX’未声明 (不在函数内)
window.h:26: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
In file included from main.c:11:
player_icon.h:7: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘player_icon’
main.c: 在函数‘quit’中:
main.c:24: 错误: ‘stream’未声明 (在此函数内第一次使用)
main.c:24: 错误: (即使在一个函数内多次出现,每个未声明的标识符在其
main.c:24: 错误: 所在的函数内也只报告一次。)
main.c:37: 警告: 内建函数 ‘sprintf’ 不兼容的隐式声明
main.c:44: 警告: 从不兼容的指针类型赋值
main.c: 在函数‘window_show’中:
main.c:50: 错误: ‘window’未声明 (在此函数内第一次使用)
main.c: 在文件层:
main.c:52: 错误: expected ‘)’ before ‘*’ token
main.c: 在函数‘creat_menu’中:
main.c:60: 错误: ‘GtkMenuItem’未声明 (在此函数内第一次使用)
main.c:60: 错误: ‘item’未声明 (在此函数内第一次使用)
main.c:61: 错误: ‘menu’未声明 (在此函数内第一次使用)
main.c:67: 错误: ‘GTK_STOCK_MEDIA_PREVIOUS’未声明 (在此函数内第一次使用)
main.c:72: 错误: ‘item_pause’未声明 (在此函数内第一次使用)
main.c:72: 错误: ‘GTK_STOCK_MEDIA_PAUSE’未声明 (在此函数内第一次使用)
main.c:76: 错误: ‘item_play’未声明 (在此函数内第一次使用)
main.c:76: 错误: ‘GTK_STOCK_MEDIA_PLAY’未声明 (在此函数内第一次使用)
main.c:80: 错误: ‘GTK_STOCK_MEDIA_NEXT’未声明 (在此函数内第一次使用)
main.c:85: 错误: ‘GTK_STOCK_QUIT’未声明 (在此函数内第一次使用)
main.c: 在函数‘main’中:
main.c:92: 错误: ‘GtkWidget’未声明 (在此函数内第一次使用)
main.c:93: 错误: ‘image’未声明 (在此函数内第一次使用)
main.c:94: 错误: ‘eventbox’未声明 (在此函数内第一次使用)
main.c:95: 错误: ‘GdkPixbuf’未声明 (在此函数内第一次使用)
main.c:95: 错误: ‘tray_icon’未声明 (在此函数内第一次使用)
main.c:97: 错误: ‘icon’未声明 (在此函数内第一次使用)
main.c:98: 错误: ‘window_icon’未声明 (在此函数内第一次使用)
main.c:98: 错误: ‘player_icon’未声明 (在此函数内第一次使用)
main.c:98: 错误: ‘FALSE’未声明 (在此函数内第一次使用)
main.c:99: 错误: ‘picture’未声明 (在此函数内第一次使用)
main.c:104: 错误: ‘show_menu’未声明 (在此函数内第一次使用)
main.c:107: 错误: ‘tips’未声明 (在此函数内第一次使用)
main.c:111: 错误: ‘GtkFunction’未声明 (在此函数内第一次使用)
main.c:111: 错误: expected ‘)’ before ‘auto_play’
make: *** [main.o] 错误 1
root@jia-laptop:~/桌面/player# 
make 前先 sudo apt-get install libgtk2.0-dev libxine-dev libxine1-ffmpeg libxine1-all-plugins
还依赖libxml-dev ,另外,我make时还提示如下错误:
gcc lyric_downloader.c -g -c `pkg-config --cflags gtk+-2.0 gthread-2.0` -I/usr/include/libxml2
lyric_downloader.c: 在函数‘tt_parse_lyricslist’中:
lyric_downloader.c:171: 警告: 赋值时将整数赋给指针,未作类型转换
lyric_downloader.c:185: 错误: ‘xmlNode’没有名为‘children’的成员
lyric_downloader.c: 在函数‘tt_get_lyrics_content_and_save’中:
lyric_downloader.c:310: 警告: 返回时将整数赋给指针,未作类型转换
make: *** [lyric_downloader.o] 错误 1
头像
naska
帖子: 11
注册时间: 2008-10-19 16:20

Re: 自己写 的一个音乐播放器

#56

帖子 naska » 2009-03-03 23:14

首先感谢你写的这个播放器,好东西啊,图很漂亮,然后就自己下了编译,没通过(所有软件已装),说找不到libxml/parser.h和libxml/tree.h,自己找了下,/usr/include里没有makefile指定的libxml文件夹,在/usr/include/gnome-xml里找到了,改了下路径,继续编译,这次是提示某个结构体没有children成员,又从tree.h中发现确实没有这个成员,是childs,改完继续编译,又没有找到makefile里的指定的库xml2,可是我/usr/lib里有,怪了,就去掉了2用libxml.so……编译提示没有xmlReadDoc之类的函数……以为是xml2里的,又用-Wl,-soname,libxml2.so.2.6.31指定了库的名字,可是还是不行……救命……


终于解决了……用ln命令添加一个xml2库的快捷方式并命名为libxml2.so(so后不带版本号)就好了,哈哈,不过标签乱码,呵呵,准备研究下你的代码!
zhangqiguang
帖子: 3
注册时间: 2009-03-04 10:16

Re: 自己写 的一个音乐播放器

#57

帖子 zhangqiguang » 2009-03-04 11:39

向大牛致敬!!!
头像
daf3707
论坛版主
帖子: 12731
注册时间: 2007-06-13 15:57
来自: 在他乡

Re: 自己写 的一个音乐播放器

#58

帖子 daf3707 » 2009-03-04 11:54

添加了2道歌曲,播放其中一首,然后在播放列表里删除全部,再按歌词键,异常退出。另外,迷你窗口,没有可以移动的柄啊,最好界面整合在一齐,不要开那么多窗。
./queplayer
main...
finch_init...
set_eq_value...
set_eq_value...
set_eq_value...
set_eq_value...
set_eq_value...
set_eq_value...
set_eq_value...
set_eq_value...
set_eq_value...
set_eq_value...
creat_tray_icon...
creat_window...
change_play_button...
creat_play_list_window...
loade_note_book_page...
notebook_page_button_clicked...6
add_button_clicked...
loade_note_book_page...
play...
change_play_button...
drow_tree...
change_tooltips...
show_lrc...
creat_lrc_window...
show_lrc...
close_creat_lrc_window...
creat_config_window...
check_close_window_to_tray_button...
check_show_mini_window_at_beginning_button...
check_show_window_at_beginning_button...
close_config_window...
creat_mini_window...
change_play_button...
creat_mini_window...
close_mini_window...
creat_config_window...
close_config_window...
del_store_row...
del_store_row...
add_button_clicked...
loade_note_book_page...
creat_lrc_window...
show_lrc...

(queplayer:12778): Gtk-WARNING **: /build/buildd/gtk+2.0-2.12.9/gtk/gtktreemodel.c:429: Negative numbers in path -1 passed to gtk_tree_path_new_from_string

(queplayer:12778): Gtk-CRITICAL **: gtk_tree_model_get_iter_from_string: assertion `path != NULL' failed

(queplayer:12778): Gtk-CRITICAL **: gtk_list_store_get_value: assertion `VALID_ITER (iter, list_store)' failed

(queplayer:12778): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.16.6/gobject/gtype.c:3362: type id `0' is invalid

(queplayer:12778): GLib-GObject-WARNING **: can't peek value table for type `<invalid>' which is not currently referenced
段错误
头像
windwhinny
帖子: 618
注册时间: 2007-09-26 17:34

Re: 自己写 的一个音乐播放器

#59

帖子 windwhinny » 2009-03-04 15:33

回56 楼 naska:
显示歌词的代码里需要装libxml2-dev,因为是直接用别人的代码,所以软件包的依赖关系没写上.
回58 楼 daf3707:
那是一个BUG,我已经更新代码,修复了
dongfanglu
帖子: 523
注册时间: 2007-12-13 23:34

Re: 自己写 的一个音乐播放器

#60

帖子 dongfanglu » 2009-03-07 16:02

出现下面的问题
zzd@Kubuntu:~/Desktop/player$ sudo sh ./install.sh
安装所需软件包........
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
libgtk2.0-dev 已经是最新的版本了。
共升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件未被升级。
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
libxine-dev 已经是最新的版本了。
共升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件未被升级。
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
libxine1-ffmpeg 已经是最新的版本了。
共升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件未被升级。
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
libxine1-all-plugins 已经是最新的版本了。
共升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件未被升级。
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
libxml2-dev 已经是最新的版本了。
共升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件未被升级。
gcc main.o window.o play.o eggtrayicon.o id3_tag.o read_config.o play_list.o http_error_codes.o http_fetcher.o lmp_debug.o lyric_downloader.o tt_codefunc.o lrc.o -g -o queplayer `pkg-config --libs gtk+-2.0 gthread-2.0` -lxml2 -lxine
collect2: ld 以信号 11 [段错误] 退出。
/usr/bin/ld: i386:x86-64 architecture of input file `main.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `window.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `play.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `eggtrayicon.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `id3_tag.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `read_config.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `play_list.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `http_error_codes.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `http_fetcher.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `lmp_debug.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `lyric_downloader.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `tt_codefunc.o' is incompatible with i386 output
make: *** [all] 错误 1
mv: 无法 stat “queplayer”: 没有该文件或目录
运行"queplayer"启动程序
回复