cosven / feeluown-core Goto Github PK
View Code? Open in Web Editor NEW提供音乐播放器的一些常见组成模块(已经合并到 feeluown 项目中)
Home Page: https://feeluown-core.readthedocs.io
License: MIT License
提供音乐播放器的一些常见组成模块(已经合并到 feeluown 项目中)
Home Page: https://feeluown-core.readthedocs.io
License: MIT License
一首歌播放结束之后,不能自动播放下一首。
多线程编程经验不足
https://github.com/cosven/feeluown-core/blob/master/fuocore/player.py#L124 这句会报:can't join current thread.
[ERROR] [__init__ exec_cmd 75] : handle cmd(action:status args:()) error
Traceback (most recent call last):
File "/home/cosven/.local/lib/python3.5/site-packages/fuocore/protocol/handlers/__init__.py", line 71, in exec_cmd
cmd_rv = handler.handle(cmd)
File "/home/cosven/.local/lib/python3.5/site-packages/fuocore/protocol/handlers/__init__.py", line 119, in handle
'song: {}'.format(show_song(player.current_song, brief=True)), # noqa
File "/home/cosven/.local/lib/python3.5/site-packages/fuocore/protocol/handlers/helpers.py", line 15, in show_song
artists = song.artists or []
AttributeError: 'NoneType' object has no attribute 'artists'
这个可以选择播放的声卡吗?怎么操作呢?
我有一些MV视频在歌曲文件夹里面。当运行 fuo --debug
的时候报错:
[INFO] [__main__ main 17] : Release mode.
Traceback (most recent call last):
File "/home/stardiviner/.virtualenvs/python3.6/bin/fuo", line 11, in <module>
sys.exit(main())
File "/home/stardiviner/.virtualenvs/python3.6/lib/python3.6/site-packages/fuocore/__main__.py", line 20, in main
local_provider = LocalProvider()
File "/home/stardiviner/.virtualenvs/python3.6/lib/python3.6/site-packages/fuocore/local/provider.py", line 48, in __init__
self.library_paths = library_paths
File "/home/stardiviner/.virtualenvs/python3.6/lib/python3.6/site-packages/fuocore/local/provider.py", line 57, in library_paths
self._songs = self.scan()
File "/home/stardiviner/.virtualenvs/python3.6/lib/python3.6/site-packages/fuocore/decorators.py", line 13, in wrapper
result = func(*args, **kwargs)
File "/home/stardiviner/.virtualenvs/python3.6/lib/python3.6/site-packages/fuocore/local/provider.py", line 84, in scan
songs = [self.model_from_fpath(fpath) for fpath in media_files]
File "/home/stardiviner/.virtualenvs/python3.6/lib/python3.6/site-packages/fuocore/local/provider.py", line 84, in <listcomp>
songs = [self.model_from_fpath(fpath) for fpath in media_files]
File "/home/stardiviner/.virtualenvs/python3.6/lib/python3.6/site-packages/fuocore/local/provider.py", line 93, in model_from_fpath
metadata = EasyMP3(fpath)
File "/home/stardiviner/.virtualenvs/python3.6/lib/python3.6/site-packages/mutagen/_file.py", line 49, in __init__
self.load(*args, **kwargs)
File "/home/stardiviner/.virtualenvs/python3.6/lib/python3.6/site-packages/mutagen/_util.py", line 140, in wrapper
return func(self, h, *args, **kwargs)
File "/home/stardiviner/.virtualenvs/python3.6/lib/python3.6/site-packages/mutagen/id3/_file.py", line 406, in load
self.info = self._Info(fileobj, offset)
File "/home/stardiviner/.virtualenvs/python3.6/lib/python3.6/site-packages/mutagen/_util.py", line 169, in wrapper
return func(*args, **kwargs)
File "/home/stardiviner/.virtualenvs/python3.6/lib/python3.6/site-packages/mutagen/mp3/__init__.py", line 403, in __init__
raise HeaderNotFoundError("can't sync to MPEG frame")
mutagen.mp3.HeaderNotFoundError: can't sync to MPEG frame
player.playlist
里使用list来存放歌曲, 在查询/添加/删除歌曲的时候复杂度均为O(n). 如果想要支持衍生的一些想法中几万张专辑这样的大歌单, 应该会非常低效.
目前有两个想法:
3种方案比较:
operation | raw list | linked list | list with empty slots |
---|---|---|---|
append | O(N) | O(1) | O(1) |
search | O(N) | O(1) | O(1) |
remove | O(N) | O(1) | Amortized O(1) |
memory | song size | song size + dict size + references x N | song size + dict size |
drawback | too slow | can't directly access by index | insertion after a song is O(N) |
目前利用整数代替歌曲测试, 添加100000整数, 然后随机删除:
可以看到第三种方案相当迅速(linked list需要在nodes 之间跳转), 但缺点在于插入歌曲时的效率依然较差.
另外, 我觉得在playlist里不必要维护 good songs和bad songs, 在 player播放有误的时候跳过就好了.
运行feel-core-test,报错"AttributeError: module 'logging' has no
attribute 'config'"。在fuocore/main.py中添加
import logging.config
后,错误消失。
以前的磁带、复读机:快退,暂停/播放,停止,快进
MP3:复读机的所有功能,曲库管理,选择某一首播放,上一首,下一首;
> resume
> pause
> stop
> play 晴天
> seek 2:34
bugfix
Restart failed, "Address already in use"refactor
code structureA declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.