cmus : C* music player : server-mode

2011-02-27
2012-12-10
  • Arthus Belliqueux

    Hi,

    Config file for cmus cli music player.

    Files and icons available here ( just untar in your ~/.anyremote/cfg-data/ )

    You can browse and queue files, which means you'll have to press 'Next' in order to listen to your song.

    %
    % cmus configuration file for cmus (Server-mode)
    %
    % cfg by Arthus Belliqueux
    % shuffle and repeat icons from Gnome icon theme 
    %
    % Needs at least anyRemote-4.16/anyremote-J2ME-client-4.1 because of icon auto uploading
    %
    % STATUS stable
    % XTEST no
    % ENV no
    % SOUND app
    % FBROWSER v.3i
    GuiAppName=cmus
    GuiAppBinary=cmus-remote
    # not sure about the next line
    GuiAppRun=cmus
    GuiAppIcon=cmus.png
    GuiAppType=Application
    GuiAppProtocols=Server
    GuiAppDesc=C* Music Player
    [Protocol]=Server
    (Init)=Include($(CfgDir)/Utils/aliases-server.cfg);\
        Make(var,from_utf,by_value,);\
        Make(var, to_utf,by_value,);
    (Connect)=Make(mode,cmus);
    [Mode]=cmus
    # To deactivate autoupload, replace 'shuffle' and 'repeat' with 'default'
    (EnterMode)=Set(icons,cmus,1,vol_down,2,mute,3,vol_up,4,rewind,5,play,6,forward,7,shuffle,8,stop,9,repeat,*,question,0,folder,#,no);\
        Set(title,);\
        Set(status,);\
        Macro(ALLIN1MENU)
    
    QUIT=Exec(echo 'P=`ps -ef|grep "cmus"|grep -v grep|grep -v anyremote|grep -v edit`; if [ "x$P" == "x" ]; then true; else cmus-remote -C quit; fi'|bash -f -s);
    UPDATEMENU=Set(menu,replace,GoTo,Queue,Go Home);
    % FBROWSER v.3i 
    FillList=Set(iconlist,replace,Files,folder:..);\
        Macro(FillDir);\
            Macro(FillFile);
    FillDir =ExecAndSet(iconlist,add,SAME,cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";ls -F --quoting-style=shell|sed 's/\*//;s/,/\r/g;s/@//;s/$/,/'|grep '/'| xargs -d '\n' -i echo "folder:" {} $(to_utf));
    FillFile=ExecAndSet(iconlist,add,SAME,cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";ls -F --quoting-style=shell|sed 's/\*//;s/,/\r/g;s/@//;s/$/,/'|grep -v '/'| xargs -d '\n' -i echo "file:"{} $(to_utf));
    GoTo($$)=Make(var,goto,echo "$(Param)"$(from_utf));\
        ExecAndSet(iconlist,replace,Files,cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";echo "if [ -d $(goto) ]; then cd $(goto);fi;pwd>$HOME/.anyRemote/ar_storedir.tmp;"|bash -f -s;echo "folder:..");\
        Macro(FillDir);\
            Macro(FillFile);
    Go Home($$)=ExecAndSet(iconlist,replace,Files,cd;pwd>$HOME/.anyRemote/ar_storedir.tmp;echo "folder:..");\
        Macro(FillDir);\
            Macro(FillFile);
    % FBROWSER v.3i 
    Cancel  =Macro(QUIT);Exit
    Back    =Set(text,close);Macro(ALLIN1MENU);
    Back($$)=Set(list,close);Macro(ALLIN1MENU);
    Open($$)=Set(list,close);\
        Set(menu,clean);\
        Macro(ALLIN1MENU);\
        Exec(cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";cmus-remote -q $(Param) "`echo $(Param)$(from_utf)`" > /dev/null);\
        ExecAndSet(title,echo "$(Param)"$(from_utf));
    1=Exec(cmus-remote -v -10%);
    2=Exec(cmus-remote -v -100%);
    3=Exec(cmus-remote -v +10%);
    4=Exec(cmus-remote -r);
    5=Exec(cmus-remote -u);
    6=Exec(cmus-remote -n);
    7=Exec(cmus-remote -S);
    8=Exec(cmus-remote -s);
    9=Exec(cmus-remote -R);
    * *=Set(text,replace,Help,1 - Vol-\n2 - Mute\n3 - Vol+\n4 - Prev\n5 - Play\n6 - Next\n7- Shuffle\n8 - Stop\n9 - Repeat\n* *- Help\n0 - File browser\n# - Exit)
    0=Macro(FillList);Macro(UPDATEMENU);
    #=Macro(QUIT)
    [ModeEnd]
    [End]
    

    Hopefully there are no mistakes in the cfg file, but I'm not sure about this. It works great for me.

    Hope it's usefull,

    AB

     
  • Arthus Belliqueux

    Ops, just spoted an error, can't I edit my post ?
    In code above, replace :

    Open($$)=Set(list,close);\
        Set(menu,clean);\
        Macro(ALLIN1MENU);\
        Exec(cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";cmus-remote -q $(Param) "`echo $(Param)$(from_utf)`" > /dev/null);\
        ExecAndSet(title,echo "$(Param)"$(from_utf));
    

    with :

    Queue($$)=Set(list,close);\
        Set(menu,clean);\
        Macro(ALLIN1MENU);\
        Exec(cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";cmus-remote -q "`echo $(Param)$(from_utf)`" > /dev/null);\
        ExecAndSet(title,echo "$(Param)"$(from_utf));
    

    Files on server have been corrected.

     
  • Mike

    Mike - 2011-03-02

    Thanks a lot for config file. Would You mind if i add it to the next release ?

     
  • Arthus Belliqueux

    Not at all, I'm glad I can be of any help to your project !

    One last thing though ; I'm not sur about what the next line does :

    GuiAppRun=echo 'A=`ps -ef|grep cmus|grep -v grep|grep -v anyremote|grep -v edit`; if [ "x$A" == "x" ]; then echo NOK; else echo OK; fi' | bash -f -s
    

    It checks for a running process 'cmus, removes any grep/anyremote added line, then runs the process if none found in the first place, is that right ?

    Anyway, maybe the line "GuiAppRun=cmus" should be corrected before you include it..

    Glad I could help,

    AB

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks