Changeset 25392 for titan/titan


Ignore:
Timestamp:
12/26/13 16:23:30 (10 years ago)
Author:
obi
Message:

add set_player_sound to player.h

Location:
titan/titan
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/global.h

    r25360 r25392  
    11#ifndef GLOBAL_H
    22#define GLOBAL_H
     3
     4//flag 0: playerstart
     5//flag 1: playerstop
     6
     7void set_player_sound(int flag)
     8{
     9        char* vol = NULL, *cmd = NULL;
     10
     11        if(flag == 1)
     12        {
     13                vol = ostrcat(getconfig("vol_playerstart", NULL), NULL, 0, 0);
     14                if(vol == NULL)
     15                        vol = ostrcat("40", NULL, 0, 0);
     16        }
     17        else
     18        {
     19                vol = ostrcat(getconfig("vol_playerstop", NULL), NULL, 0, 0);
     20                if(vol == NULL)
     21                        vol = ostrcat("70", NULL, 0, 0);
     22       
     23        }
     24
     25        cmd = ostrcat("amixer -c 1 set Analog playback '", vol, 0, 0);
     26        cmd = ostrcat(cmd, "%' unmute &", 1, 0);
     27        system(cmd);
     28        free(cmd), cmd = NULL;
     29
     30        cmd = ostrcat("amixer -c 1 set SPDIF playback '", vol, 0, 0);
     31        cmd = ostrcat(cmd, "%' unmute &", 1, 0);
     32        system(cmd);
     33        free(cmd), cmd = NULL;
     34
     35        cmd = ostrcat("amixer -c 1 set HDMI playback '", vol, 0, 0);
     36        cmd = ostrcat(cmd, "%' unmute &", 1, 0);
     37        system(cmd);
     38        free(cmd), cmd = NULL;
     39        free(vol), vol = NULL;
     40}
    341
    442//flag 0: with wait message
  • titan/titan/header.h

    r25133 r25392  
    797797void waitmsgbar(int sec, int exit, char* text, int flag);
    798798char* getcolorformat(int line);
     799void set_player_sound(int flag);
    799800
    800801//rcconfig.h
  • titan/titan/player.h

    r24845 r25392  
    578578                        return 1;
    579579                }
     580
     581                set_player_sound(0);
    580582
    581583                if(ostrstr(tmpfile, "file://") == NULL)
     
    960962        free(player);
    961963        player = NULL;
     964        set_player_sound(1);
    962965#endif
    963966
Note: See TracChangeset for help on using the changeset viewer.