LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1538|回复: 3

一直在寻找sitman的代替软件

[复制链接]
发表于 2007-9-23 15:11:22 | 显示全部楼层 |阅读模式
有那位高手推荐一个。

学习英语也需要阿。
 楼主| 发表于 2007-10-21 12:17:56 | 显示全部楼层
自顶一下

类似的也行啊
回复 支持 反对

使用道具 举报

发表于 2007-10-26 01:20:44 | 显示全部楼层
emacs 的插件,调用mpg321来播放,凑合能用.

将要听的mp3复制到/tmp/voa.mp3
f5播放,Shift-f5退出
f6跳到A-B区间的开头
Shift-f6暂停
f7设置复度区间的结尾B点
f8进入下一个区间


  1. (defvar repeater-process-name "repeater-proc"
  2.   "The name of the mpg321 remote player process")
  3. (defvar repeater-music-name "/tmp/voa.mp3"
  4.   "The default mp3 to be played")
  5. (defvar var-repeater-insert-end-point 0)
  6. (defvar repeater-begin 0)
  7. (defvar repeater-end 0)

  8. (defun repeater-start-process ()
  9.   (interactive)
  10.   "Run the mpg321 as the background program."
  11.   (let ((process (apply 'start-process
  12.                         repeater-process-name
  13.                         nil
  14.                         "mpg123"
  15.                         (list "-R" "-"))));;"-o alsa"
  16.     (set-process-sentinel process 'repeater-sentinel)
  17.     (set-process-filter process 'repeater-filter)
  18.     process))

  19. (defun repeater-filter (proc str)
  20.   (let* ((data-lines (split-string str "\n" t))
  21.          data line cmd)
  22.     (dolist (line data-lines)
  23.       (setq data (split-string line))
  24.       (setq cmd (car data))
  25.       (cond
  26.        ;; stop notice
  27.        ((and (string= cmd "@P")
  28.              (string= (cadr data) "0"))
  29.         (repeter-stop-notify)) ;;here~~~~
  30.        ;; frame notice
  31.        ((string= cmd "@F")
  32.         (repeater-check-functions (string-to-number (nth 1 data)))
  33.         )))))

  34. (defun repeater-sentinel (proc str)
  35.   "Sentinel for determining the end of process"
  36.   (when (or (eq (process-status proc) 'exit)
  37.             (eq (process-status proc) 'signal))
  38.     ;; reset
  39.     (setq repeater-ignore-stop 0)
  40.     (message "Remote process died!")))

  41. (defun repeter-stop-notify()
  42.   "Recevied the stop notice."
  43.   (repeater-start repeater-music-name)
  44.   )

  45. (defun repeater-check-functions(point)
  46.   "Check point to repeat"
  47.   ;;case
  48.   (if (eq var-repeater-insert-end-point 1)
  49.    (setq repeater-end point var-repeater-insert-end-point 0)
  50.    ;//insert end point
  51.   )
  52. ;;;test
  53.   (if (or (< point repeater-begin) (and (> repeater-end 0) (> point repeater-end)))(repeater-jump (number-to-string repeater-begin))))


  54. (defun repeater-send (text)
  55.   "Send TEXT to the mpg321 remote process, and add a newline."
  56.   (let (proc)
  57.     ;; we shouldn't be trying to send to a dead process
  58.     (unless (repeater-running-p)
  59.       (repeater-start-process))
  60.     (setq proc  (repeater-process))
  61.     (process-send-string proc (concat text "\n"))
  62.     (message text)
  63. ))


  64. (defun repeater-running-p ()
  65.   "True if the remote process exists and is running."
  66.   (let ((proc (repeater-process)))
  67.     (and proc
  68.          (eq (process-status proc) 'run))))

  69. (defun repeater-process ()
  70.   "Return the remote process, if it exists."
  71.   (get-process repeater-process-name))


  72. ;;(defun repeater-play-track (track)
  73. (defun repeater-play-track (track)
  74.   "Send a play command to the remote, based on TRACK."
  75.   (repeater-send
  76.    (concat "load " track))
  77.   )


  78. (defun repeater-start (track)
  79.   (interactive)
  80.   "Start playing a song by telling the remote process to play it.
  81. If the remote process is not running, launch it."
  82.   (unless (repeater-running-p)
  83.     (repeater-start-process))
  84.   (repeater-play-track track))

  85. (defun repeater-quit ()
  86.    (interactive)
  87.   "Quit mpg321"
  88.   ;;(emms-player-mpg321-remote-notify-emms t)
  89.   (repeater-send "quit")
  90. )


  91. (defun repeater-pause ()
  92.   (interactive)
  93.   "Pause the player."
  94.   (repeater-send "pause")
  95. )

  96. (defun repeater-jump(frame)
  97.   (interactive)
  98. "Jump to the special frame."
  99.   (repeater-send (concat "jump " frame))
  100. )

  101. (defun repeater-default() ;;/test
  102.   (interactive)
  103.   (setq repeater-begin 0 repeater-end 0)
  104.   (repeater-start repeater-music-name)
  105.   )
  106. (defun repeater-insert-end-point()
  107.   (interactive)
  108.   (setq var-repeater-insert-end-point 1)
  109.   )

  110. (defun repeater-clear-point()
  111.   (interactive)
  112.   (setq repeater-begin 0 repeater-end 0)
  113.    (message "Clear all point")
  114. )

  115. (defun repeater-other-range()
  116.   (interactive)
  117.   (if (eq repeater-end 0)(setq repeater-end repeater-begin repeater-begin 0)
  118.   (setq repeater-begin repeater-end repeater-end 0)
  119.   )
  120. )
  121. (defun repeater-jump-begin()
  122.   (interactive)
  123.   (repeater-jump (number-to-string repeater-begin))
  124. )

  125. (global-set-key (kbd "<f5>") 'repeater-default)
  126. (global-set-key (kbd "<S-f5>") 'repeater-quit)
  127. (global-set-key (kbd "<S-f6>") 'repeater-pause)
  128. (global-set-key (kbd "<f6>") 'repeater-jump-begin)
  129. (global-set-key (kbd "<f7>") 'repeater-insert-end-point)
  130. (global-set-key (kbd "<f8>") 'repeater-other-range)
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-10-29 14:43:18 | 显示全部楼层
厉害阿,可惜我不会,
只想找一个相似的
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表