source: titan/titan/mute.h

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

[titan] fix

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