source: titan/titan/mute.h @ 41390

Last change on this file since 41390 was 40430, checked in by gost, 7 years ago

[titan] fix

File size: 1.9 KB
Line 
1#ifndef MUTE_H
2#define MUTE_H
3
4//screen and node are needed if funktion is called from rc handle
5//flag 1 = no blit
6//flag 2 = no framebuffer lock
7//flag 3 = no framebuffer lock and no blit
8void screenmute(struct skin* screen, struct skin* node, int flag)
9{
10        struct skin* framebuffer = getscreen("framebuffer");
11        struct skin* mute = getscreen("mute");
12
13#ifdef MIPSEL
14        if(getconfigint("ForwardVolume", NULL) == 1)
15        {
16                forwardKey(getrcconfigint("rcmute", NULL));
17                return;
18        }
19#endif
20       
21        if(getconfig("stepmute", NULL) == NULL)
22                addconfig("stepmute", "0");
23               
24        if(status.mute == 0 && atoi(getconfig("stepmute", NULL)) == 1)
25                setmute(2);
26        else if(status.mute == 0 || status.mute == 2)
27        {
28                m_lock(&status.vfdmutex, 3);
29                if(status.mute == 2)
30                        setvol(getconfigint("vol", NULL));
31                setmute(1);
32#ifndef MIPSEL
33//#ifdef SH4
34                system("amixer -c 1 set HDMI mute &");
35                system("amixer -c 1 set Analog mute &");
36                system("amixer -c 1 set SPDIF mute &");
37                audiostop(status.aktservice->audiodev);
38#endif
39                setnodeattr(mute, framebuffer, 0);
40                if(status.drawallwaysbg[0] != NULL)
41                {
42                        free(status.drawallwaysbg[0]);
43                        status.drawallwaysbg[0] = NULL;
44                }
45                status.drawallwaysbg[0] = savescreen(mute);
46                if(flag == 2 || flag == 3)
47                        drawscreen(mute, 0, 2);
48                else
49                        drawscreen(mute, 0, 0);
50                status.drawallways[0] = mute;
51                m_unlock(&status.vfdmutex, 3);
52        }
53        else
54        {
55#ifndef MIPSEL
56//#ifdef SH4
57                audioplay(status.aktservice->audiodev);
58                system("amixer -c 1 set HDMI unmute &");
59                system("amixer -c 1 set Analog unmute &");
60                system("amixer -c 1 set SPDIF unmute &");
61#endif
62                m_lock(&status.vfdmutex, 3);
63                setmute(0);
64                if(flag == 2 || flag == 3)
65                        clearscreennolock(mute);
66                else
67                        clearscreen(mute);
68                if(status.drawallwaysbg[0] != NULL)
69                {
70                        restorescreen(status.drawallwaysbg[0], mute);
71                        status.drawallwaysbg[0] = NULL;
72                }
73                status.drawallways[0] = NULL;
74                if(flag == 0 || flag == 2)
75                        blitfb(0);
76                m_unlock(&status.vfdmutex, 3);
77        }
78}
79
80#endif
Note: See TracBrowser for help on using the repository browser.