source: titan/titan/autores.h @ 42276

Last change on this file since 42276 was 27680, checked in by obi, 10 years ago

fix

File size: 1.6 KB
Line 
1#ifndef AUTORES_H
2#define AUTORES_H
3
4void screenautores(char* text, int timeout, int flag)
5{
6        int rcret = -1, fromthread = 0;
7        struct skin* autores = getscreen("autores");
8        struct skin* framebuffer = getscreen("framebuffer");
9        char* bg = NULL;
10
11        if(pthread_self() != status.mainthread)
12                fromthread = 1;
13
14        changetext(autores, text);
15
16        if(fromthread == 1)
17        {
18                delrc(getrcconfigint("rcvolup", NULL), NULL, NULL);
19                delrc(getrcconfigint("rcvoldown", NULL), NULL, NULL);
20                delrc(getrcconfigint("rcmute", NULL), NULL, NULL);
21                m_lock(&status.drawingmutex, 0);
22                m_lock(&status.rcmutex, 10);
23                setnodeattr(autores, framebuffer, 2);
24                status.rcowner = autores;
25                bg = savescreen(autores);
26                drawscreen(autores, 0, 2);
27        }
28        else
29                drawscreen(autores, 0, 0);
30
31        //deaktivate for test, so we can end the screen with each keypress
32        //while(rcret != RCTIMEOUT && rcret != getrcconfigint("rcexit", NULL))
33                        rcret = waitrc(autores, timeout * 1000, 0);
34
35        if(fromthread != 1)
36                delownerrc(autores);
37
38        if(fromthread == 1)
39        {
40                clearscreennolock(autores);
41                restorescreen(bg, autores);
42                blitfb(0);
43                sleep(1);
44                status.rcowner = NULL;
45                m_unlock(&status.rcmutex, 10);
46                m_unlock(&status.drawingmutex, 0);
47                addrc(getrcconfigint("rcvolup", NULL), screenvolumeup, NULL, NULL);
48                addrc(getrcconfigint("rcvoldown", NULL), screenvolumedown, NULL, NULL);
49                addrc(getrcconfigint("rcmute", NULL), screenmute, NULL, NULL);
50        }
51        else
52        {
53                clearscreen(autores);
54                drawscreen(skin, 0, 0);
55        }
56
57        //if(rcret != RCTIMEOUT) writerc(rcret);
58}
59
60void autoresthreadfunc(struct stimerthread* self, char* text, int timeout)
61{
62        screenautores(text, timeout, 0);
63}
64
65#endif
Note: See TracBrowser for help on using the repository browser.