Giter Site home page Giter Site logo

Comments (3)

taizilongxu avatar taizilongxu commented on September 26, 2024

不是啥大神啊,这部分的静音,暂停功能是@cloverstd做的;

cmd = 'mplayer -slave -input file={fifo} {song_url} >/dev/null 2>&1'

这个 cmd 就是在终端里运行的命令,调用 mplayer, 后台运行

这个 file={fifo}应当是暂停状态保存的位置,具体可以查看 mplayer 手册或者@cloverstd

歌曲信息没有传给管道,传给了self.SUFFIX_SELECTED,它主要在 cli 里负责在界面中显示歌曲信息

from douban.fm.

cloverstd avatar cloverstd commented on September 26, 2024

调用 mplayer 是通过 subprocess 开启一个子进程(我的操作系统学的不好,我是这么理解的),在子进程中执行 mplayer

不是将歌曲信息传递给 fifo,而是将对于 mplayer 的操作从程序主进程传递给子线程中,而要传递信息给子进程有很多方法,maplyer 支持通过 fifo 来传递信息给 maplyer,具体你可以看这个文档

from douban.fm.

itfanr avatar itfanr commented on September 26, 2024

@cloverstd @taizilongxu 我大概明白了。是mplayer是子进程,而当前进程与mplayer是通过fifo通信的,主进程将播放指令发给mplayer进程。

from douban.fm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.