source: titan/titan/mute.h @ 40413

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

[titan] mipsel/arm new cec functions

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        if(getconfigint("ForwardVolume", NULL) == 1)
14        {
15                forwardKey(getrcconfigint("rcmute", NULL));
16                return;
17        }
18       
19        if(getconfig("stepmute", NULL) == NULL)
20                addconfig("stepmute", "0");
21               
22        if(status.mute == 0 && atoi(getconfig("stepmute", NULL)) == 1)
23                setmute(2);
24        else if(status.mute == 0 || status.mute == 2)
25        {
26                m_lock(&status.vfdmutex, 3);
27                if(status.mute == 2)
28                        setvol(getconfigint("vol", NULL));
29                setmute(1);
30#ifndef MIPSEL
31//#ifdef SH4
32                system("amixer -c 1 set HDMI mute &");
33                system("amixer -c 1 set Analog mute &");
34                system("amixer -c 1 set SPDIF mute &");
35                audiostop(status.aktservice->audiodev);
36#endif
37                setnodeattr(mute, framebuffer, 0);
38                if(status.drawallwaysbg[0] != NULL)
39                {
40                        free(status.drawallwaysbg[0]);
41                        status.drawallwaysbg[0] = NULL;
42                }
43                status.drawallwaysbg[0] = savescreen(mute);
44                if(flag == 2 || flag == 3)
45                        drawscreen(mute, 0, 2);
46                else
47                        drawscreen(mute, 0, 0);
48                status.drawallways[0] = mute;
49                m_unlock(&status.vfdmutex, 3);
50        }
51        else
52        {
53#ifndef MIPSEL
54//#ifdef SH4
55                audioplay(status.aktservice->audiodev);
56                system("amixer -c 1 set HDMI unmute &");
57                system("amixer -c 1 set Analog unmute &");
58                system("amixer -c 1 set SPDIF unmute &");
59#endif
60                m_lock(&status.vfdmutex, 3);
61                setmute(0);
62                if(flag == 2 || flag == 3)
63                        clearscreennolock(mute);
64                else
65                        clearscreen(mute);
66                if(status.drawallwaysbg[0] != NULL)
67                {
68                        restorescreen(status.drawallwaysbg[0], mute);
69                        status.drawallwaysbg[0] = NULL;
70                }
71                status.drawallways[0] = NULL;
72                if(flag == 0 || flag == 2)
73                        blitfb(0);
74                m_unlock(&status.vfdmutex, 3);
75        }
76}
77
78#endif
Note: See TracBrowser for help on using the repository browser.