parent
17c34a3959
commit
e117fe4368
49
src/E.h
49
src/E.h
|
@ -218,15 +218,6 @@ if (__xim) XDestroyImage(__xim);}
|
|||
AssignRestartText(c); \
|
||||
AssignExitText(d);
|
||||
|
||||
/************************************************************************/
|
||||
/* sound macro convenience funcs */
|
||||
/************************************************************************/
|
||||
|
||||
#define AUDIO_PLAY(sclass) \
|
||||
ApplySclass(FindItem((sclass), 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS));
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
#ifndef HAVE_GETCWD
|
||||
#error "ERROR: Enlightenment needs a system with getcwd() in it's libs."
|
||||
#error "You may have to upgrade your Operating system, Distribution, base"
|
||||
|
@ -637,6 +628,7 @@ typedef struct _iconbox Iconbox;
|
|||
typedef struct _group Group;
|
||||
typedef struct _button Button;
|
||||
typedef struct _buttoncontainer Container;
|
||||
typedef struct _soundclass SoundClass;
|
||||
|
||||
typedef struct _efont Efont;
|
||||
|
||||
|
@ -1159,26 +1151,6 @@ typedef struct _desktops
|
|||
}
|
||||
Desktops;
|
||||
|
||||
typedef struct _sample
|
||||
{
|
||||
char *file;
|
||||
int rate;
|
||||
int format;
|
||||
int samples;
|
||||
unsigned char *data;
|
||||
int id;
|
||||
}
|
||||
Sample;
|
||||
|
||||
typedef struct _soundclass
|
||||
{
|
||||
char *name;
|
||||
char *file;
|
||||
Sample *sample;
|
||||
unsigned int ref_count;
|
||||
}
|
||||
SoundClass;
|
||||
|
||||
typedef struct _windowmatch
|
||||
{
|
||||
char *name;
|
||||
|
@ -1648,10 +1620,10 @@ void EdgeHandleLeave(XEvent * ev);
|
|||
void EdgeHandleMotion(XEvent * ev);
|
||||
|
||||
/* lists.c functions */
|
||||
void *FindItem(char *name, int id, int find_by, int type);
|
||||
void AddItem(void *item, char *name, int id, int type);
|
||||
void AddItemEnd(void *item, char *name, int id, int type);
|
||||
void *RemoveItem(char *name, int id, int find_by, int type);
|
||||
void *FindItem(const char *name, int id, int find_by, int type);
|
||||
void AddItem(void *item, const char *name, int id, int type);
|
||||
void AddItemEnd(void *item, const char *name, int id, int type);
|
||||
void *RemoveItem(const char *name, int id, int find_by, int type);
|
||||
void *RemoveItemByPtr(void *ptritem, int type);
|
||||
void **ListItemType(int *num, int type);
|
||||
char **ListItems(int *num, int type);
|
||||
|
@ -2255,14 +2227,12 @@ void HintsProcessClientMessage(XClientMessageEvent * event);
|
|||
void HintsSetRootInfo(Window win, Pixmap pmap, int color);
|
||||
|
||||
/* sound.c functions */
|
||||
Sample *LoadWav(char *file);
|
||||
void SoundPlay(Sample * s);
|
||||
void DestroySample(Sample * s);
|
||||
void DestroySclass(SoundClass * sclass);
|
||||
SoundClass *CreateSoundClass(char *name, char *file);
|
||||
void ApplySclass(SoundClass * sclass);
|
||||
SoundClass *SclassCreate(const char *name, const char *file);
|
||||
const char *SclassGetName(SoundClass * sclass);
|
||||
void SoundInit(void);
|
||||
void SoundExit(void);
|
||||
int SoundPlay(const char *name);
|
||||
int SoundFree(const char *name);
|
||||
|
||||
/* regex.c functions */
|
||||
int matchregexp(const char *rx, const char *s);
|
||||
|
@ -2852,7 +2822,6 @@ extern Window init_win2;
|
|||
extern Window init_win_ext;
|
||||
extern Window bpress_win;
|
||||
extern int deskorder[ENLIGHTENMENT_CONF_NUM_DESKTOPS];
|
||||
extern int sound_fd;
|
||||
|
||||
#define FILEPATH_LEN_MAX 4096
|
||||
extern char themepath[FILEPATH_LEN_MAX];
|
||||
|
|
|
@ -564,22 +564,22 @@ spawnMenu(void *params)
|
|||
sscanf((char *)params, "%1000s %1000s", s, s2);
|
||||
if (!strcmp(s, "deskmenu"))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_MENU_SHOW");
|
||||
SoundPlay("SOUND_MENU_SHOW");
|
||||
ShowDeskMenu();
|
||||
}
|
||||
else if (!strcmp(s, "taskmenu"))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_MENU_SHOW");
|
||||
SoundPlay("SOUND_MENU_SHOW");
|
||||
ShowAllTaskMenu();
|
||||
}
|
||||
else if (!strcmp(s, "groupmenu"))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_MENU_SHOW");
|
||||
SoundPlay("SOUND_MENU_SHOW");
|
||||
ShowGroupMenu();
|
||||
}
|
||||
else if (!strcmp(s, "named"))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_MENU_SHOW");
|
||||
SoundPlay("SOUND_MENU_SHOW");
|
||||
ShowNamedMenu(s2);
|
||||
}
|
||||
|
||||
|
@ -874,7 +874,7 @@ doResize(void *params)
|
|||
GrabX();
|
||||
}
|
||||
queue_up = 0;
|
||||
AUDIO_PLAY("SOUND_RESIZE_START");
|
||||
SoundPlay("SOUND_RESIZE_START");
|
||||
UnGrabTheButtons();
|
||||
GrabConfineThePointer(root.win);
|
||||
mode.mode = MODE_RESIZE;
|
||||
|
@ -929,7 +929,7 @@ doResizeH(void *params)
|
|||
GrabX();
|
||||
}
|
||||
queue_up = 0;
|
||||
AUDIO_PLAY("SOUND_RESIZE_START");
|
||||
SoundPlay("SOUND_RESIZE_START");
|
||||
UnGrabTheButtons();
|
||||
GrabConfineThePointer(root.win);
|
||||
mode.mode = MODE_RESIZE_H;
|
||||
|
@ -978,7 +978,7 @@ doResizeV(void *params)
|
|||
GrabX();
|
||||
}
|
||||
queue_up = 0;
|
||||
AUDIO_PLAY("SOUND_RESIZE_START");
|
||||
SoundPlay("SOUND_RESIZE_START");
|
||||
UnGrabTheButtons();
|
||||
GrabConfineThePointer(root.win);
|
||||
mode.mode = MODE_RESIZE_V;
|
||||
|
@ -1011,7 +1011,7 @@ doResizeEnd(void *params)
|
|||
EDBUG(0, "doResizeEnd");
|
||||
ewin = GetFocusEwin();
|
||||
UnGrabTheButtons();
|
||||
AUDIO_PLAY("SOUND_RESIZE_STOP");
|
||||
SoundPlay("SOUND_RESIZE_STOP");
|
||||
if (!ewin)
|
||||
{
|
||||
if (mode.resizemode > 0)
|
||||
|
@ -1080,7 +1080,7 @@ doMoveImpl(void *params, char constrained)
|
|||
}
|
||||
UnGrabTheButtons();
|
||||
GrabConfineThePointer(root.win);
|
||||
AUDIO_PLAY("SOUND_MOVE_START");
|
||||
SoundPlay("SOUND_MOVE_START");
|
||||
mode.mode = MODE_MOVE;
|
||||
mode.constrained = constrained;
|
||||
mode.start_x = mode.x;
|
||||
|
@ -1153,7 +1153,7 @@ doMoveEnd(void *params)
|
|||
EDBUG(6, "doMoveEnd");
|
||||
ewin = GetFocusEwin();
|
||||
UnGrabTheButtons();
|
||||
AUDIO_PLAY("SOUND_MOVE_STOP");
|
||||
SoundPlay("SOUND_MOVE_STOP");
|
||||
if (!ewin)
|
||||
{
|
||||
if (mode.movemode > 0)
|
||||
|
@ -1258,7 +1258,7 @@ doRaise(void *params)
|
|||
if (!ewin)
|
||||
EDBUG_RETURN(0);
|
||||
|
||||
AUDIO_PLAY("SOUND_RAISE");
|
||||
SoundPlay("SOUND_RAISE");
|
||||
|
||||
gwins = ListWinGroupMembersForEwin(ewin, ACTION_RAISE, mode.nogroup, &num);
|
||||
for (i = 0; i < num; i++)
|
||||
|
@ -1298,7 +1298,7 @@ doLower(void *params)
|
|||
if (!ewin)
|
||||
EDBUG_RETURN(0);
|
||||
|
||||
AUDIO_PLAY("SOUND_LOWER");
|
||||
SoundPlay("SOUND_LOWER");
|
||||
|
||||
gwins = ListWinGroupMembersForEwin(ewin, ACTION_LOWER, mode.nogroup, &num);
|
||||
for (i = 0; i < num; i++)
|
||||
|
@ -1547,7 +1547,7 @@ doKillNasty(void *params)
|
|||
if (!ewin)
|
||||
EDBUG_RETURN(0);
|
||||
|
||||
AUDIO_PLAY("SOUND_WINDOW_CLOSE");
|
||||
SoundPlay("SOUND_WINDOW_CLOSE");
|
||||
EDestroyWindow(disp, ewin->client.win);
|
||||
EDBUG_RETURN(0);
|
||||
}
|
||||
|
@ -1569,7 +1569,7 @@ doNextDesktop(void *params)
|
|||
GotoDesktop(nd);
|
||||
|
||||
if (desks.current != pd)
|
||||
AUDIO_PLAY("SOUND_DESKTOP_SHUT");
|
||||
SoundPlay("SOUND_DESKTOP_SHUT");
|
||||
|
||||
EDBUG_RETURN(0);
|
||||
}
|
||||
|
@ -1591,7 +1591,7 @@ doPrevDesktop(void *params)
|
|||
GotoDesktop(nd);
|
||||
|
||||
if (desks.current != pd)
|
||||
AUDIO_PLAY("SOUND_DESKTOP_SHUT");
|
||||
SoundPlay("SOUND_DESKTOP_SHUT");
|
||||
|
||||
EDBUG_RETURN(0);
|
||||
}
|
||||
|
@ -1613,7 +1613,7 @@ doRaiseDesktop(void *params)
|
|||
d = desks.current;
|
||||
else
|
||||
d = atoi((char *)params);
|
||||
AUDIO_PLAY("SOUND_DESKTOP_RAISE");
|
||||
SoundPlay("SOUND_DESKTOP_RAISE");
|
||||
RaiseDesktop(d);
|
||||
EDBUG_RETURN(0);
|
||||
}
|
||||
|
@ -1635,7 +1635,7 @@ doLowerDesktop(void *params)
|
|||
d = desks.current;
|
||||
else
|
||||
d = atoi((char *)params);
|
||||
AUDIO_PLAY("SOUND_DESKTOP_LOWER");
|
||||
SoundPlay("SOUND_DESKTOP_LOWER");
|
||||
LowerDesktop(d);
|
||||
EDBUG_RETURN(0);
|
||||
}
|
||||
|
@ -1877,7 +1877,7 @@ doInplaceDesktop(void *params)
|
|||
GotoDesktop(d);
|
||||
if (desks.current != pd)
|
||||
{
|
||||
AUDIO_PLAY("SOUND_DESKTOP_SHUT");
|
||||
SoundPlay("SOUND_DESKTOP_SHUT");
|
||||
}
|
||||
EDBUG_RETURN(0);
|
||||
}
|
||||
|
@ -2077,8 +2077,6 @@ doMapSlideSet(void *params)
|
|||
int
|
||||
doSoundSet(void *params)
|
||||
{
|
||||
SoundClass **lst;
|
||||
int num, i;
|
||||
char snd;
|
||||
|
||||
EDBUG(6, "doSoundSet");
|
||||
|
@ -2094,24 +2092,10 @@ doSoundSet(void *params)
|
|||
}
|
||||
if (mode.sound != snd)
|
||||
{
|
||||
if (!mode.sound)
|
||||
{
|
||||
lst = (SoundClass **) ListItemType(&num, LIST_TYPE_SCLASS);
|
||||
if (lst)
|
||||
{
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
if (lst[i]->sample)
|
||||
DestroySample(lst[i]->sample);
|
||||
lst[i]->sample = NULL;
|
||||
}
|
||||
Efree(lst);
|
||||
}
|
||||
close(sound_fd);
|
||||
sound_fd = -1;
|
||||
}
|
||||
else
|
||||
if (mode.sound)
|
||||
SoundInit();
|
||||
else
|
||||
SoundExit();
|
||||
}
|
||||
autosave();
|
||||
EDBUG_RETURN(0);
|
||||
|
@ -2316,7 +2300,7 @@ doPlaySoundClass(void *params)
|
|||
if (!params)
|
||||
EDBUG_RETURN(0);
|
||||
|
||||
ApplySclass(FindItem((char *)params, 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS));
|
||||
SoundPlay((char *)params);
|
||||
|
||||
EDBUG_RETURN(0);
|
||||
}
|
||||
|
@ -2335,7 +2319,7 @@ doGotoDesktop(void *params)
|
|||
|
||||
sscanf((char *)params, "%i", &d);
|
||||
GotoDesktop(d);
|
||||
AUDIO_PLAY("SOUND_DESKTOP_SHUT");
|
||||
SoundPlay("SOUND_DESKTOP_SHUT");
|
||||
EDBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
@ -2569,7 +2553,7 @@ doSlideout(void *params)
|
|||
s = FindItem((char *)params, 0, LIST_FINDBY_NAME, LIST_TYPE_SLIDEOUT);
|
||||
if (s)
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SLIDEOUT_SHOW");
|
||||
SoundPlay("SOUND_SLIDEOUT_SHOW");
|
||||
ShowSlideout(s, mode.context_win);
|
||||
s->ref_count++;
|
||||
}
|
||||
|
@ -2640,13 +2624,13 @@ doShade(void *params)
|
|||
if (gwins[i]->shaded
|
||||
&& ((curr_group && !curr_group->cfg.mirror) || shaded))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_UNSHADE");
|
||||
SoundPlay("SOUND_UNSHADE");
|
||||
UnShadeEwin(gwins[i]);
|
||||
}
|
||||
else if (!gwins[i]->shaded
|
||||
&& ((curr_group && !curr_group->cfg.mirror) || !shaded))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SHADE");
|
||||
SoundPlay("SOUND_SHADE");
|
||||
ShadeEwin(gwins[i]);
|
||||
}
|
||||
params = NULL;
|
||||
|
@ -3001,11 +2985,11 @@ doSetLayer(void *params)
|
|||
l = atoi((char *)params);
|
||||
if (ewin->layer > l)
|
||||
{
|
||||
AUDIO_PLAY("SOUND_WINDOW_CHANGE_LAYER_DOWN");
|
||||
SoundPlay("SOUND_WINDOW_CHANGE_LAYER_DOWN");
|
||||
}
|
||||
else if (ewin->layer < l)
|
||||
{
|
||||
AUDIO_PLAY("SOUND_WINDOW_CHANGE_LAYER_UP");
|
||||
SoundPlay("SOUND_WINDOW_CHANGE_LAYER_UP");
|
||||
}
|
||||
ewin->layer = l;
|
||||
RaiseEwin(ewin);
|
||||
|
@ -3121,7 +3105,7 @@ doSetWinBorder(void *params)
|
|||
{
|
||||
if (b != gwins[i]->border)
|
||||
{
|
||||
AUDIO_PLAY("SOUND_WINDOW_BORDER_CHANGE");
|
||||
SoundPlay("SOUND_WINDOW_BORDER_CHANGE");
|
||||
shadechange = 0;
|
||||
if (gwins[i]->shaded)
|
||||
{
|
||||
|
@ -3522,7 +3506,7 @@ doInsertKeys(void *params)
|
|||
XGetInputFocus(disp, &win, &rev);
|
||||
if (win)
|
||||
{
|
||||
AUDIO_PLAY("SOUND_INSERT_KEYS");
|
||||
SoundPlay("SOUND_INSERT_KEYS");
|
||||
ev.window = win;
|
||||
for (i = 0; i < (int)strlen(s); i++)
|
||||
{
|
||||
|
@ -3565,7 +3549,7 @@ doCreateIconbox(void *params)
|
|||
{
|
||||
Iconbox *ib;
|
||||
|
||||
AUDIO_PLAY("SOUND_NEW_ICONBOX");
|
||||
SoundPlay("SOUND_NEW_ICONBOX");
|
||||
ib = IconboxCreate(params);
|
||||
IconboxShow(ib);
|
||||
}
|
||||
|
@ -3579,7 +3563,7 @@ doCreateIconbox(void *params)
|
|||
if (ibl)
|
||||
Efree(ibl);
|
||||
Esnprintf(s, sizeof(s), "_IB_%i", num);
|
||||
AUDIO_PLAY("SOUND_NEW_ICONBOX");
|
||||
SoundPlay("SOUND_NEW_ICONBOX");
|
||||
ib = IconboxCreate(s);
|
||||
IconboxShow(ib);
|
||||
}
|
||||
|
@ -3648,13 +3632,13 @@ doRaiseLower(void *params)
|
|||
|
||||
if (!raise)
|
||||
{
|
||||
AUDIO_PLAY("SOUND_LOWER");
|
||||
SoundPlay("SOUND_LOWER");
|
||||
for (j = 0; j < num; j++)
|
||||
LowerEwin(gwins[j]);
|
||||
}
|
||||
else
|
||||
{
|
||||
AUDIO_PLAY("SOUND_RAISE");
|
||||
SoundPlay("SOUND_RAISE");
|
||||
for (j = 0; j < num; j++)
|
||||
RaiseEwin(gwins[j]);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ Alert(char *fmt, ...)
|
|||
va_start(ap, fmt);
|
||||
Evsnprintf(text, 10240, fmt, ap);
|
||||
va_end(ap);
|
||||
AUDIO_PLAY("SOUND_ALERT");
|
||||
SoundPlay("SOUND_ALERT");
|
||||
ShowAlert(text);
|
||||
|
||||
EDBUG_RETURN_;
|
||||
|
|
|
@ -258,19 +258,19 @@ SetCurrentArea(int ax, int ay)
|
|||
dy = ay - desks.desk[desks.current].current_area_y;
|
||||
if (dx < 0)
|
||||
{
|
||||
AUDIO_PLAY("SOUND_MOVE_AREA_LEFT");
|
||||
SoundPlay("SOUND_MOVE_AREA_LEFT");
|
||||
}
|
||||
else if (dx > 0)
|
||||
{
|
||||
AUDIO_PLAY("SOUND_MOVE_AREA_RIGHT");
|
||||
SoundPlay("SOUND_MOVE_AREA_RIGHT");
|
||||
}
|
||||
else if (dy < 0)
|
||||
{
|
||||
AUDIO_PLAY("SOUND_MOVE_AREA_UP");
|
||||
SoundPlay("SOUND_MOVE_AREA_UP");
|
||||
}
|
||||
else if (dy > 0)
|
||||
{
|
||||
AUDIO_PLAY("SOUND_MOVE_AREA_DOWN");
|
||||
SoundPlay("SOUND_MOVE_AREA_DOWN");
|
||||
}
|
||||
|
||||
/* if we're in move mode.... and its non opaque undraw our boxes */
|
||||
|
|
|
@ -771,7 +771,7 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
|
|||
{
|
||||
if (!last_res)
|
||||
{
|
||||
/* AUDIO_PLAY("SOUND_MOVE_RESIST"); */
|
||||
/* SoundPlay("SOUND_MOVE_RESIST"); */
|
||||
last_res = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ KillEwin(EWin * ewin)
|
|||
for (j = 0; j < num_groups; j++)
|
||||
RemoveEwinFromGroup(gwins[i], gwins[i]->groups[0]);
|
||||
ICCCM_Delete(gwins[i]);
|
||||
AUDIO_PLAY("SOUND_WINDOW_CLOSE");
|
||||
SoundPlay("SOUND_WINDOW_CLOSE");
|
||||
}
|
||||
Efree(gwins);
|
||||
}
|
||||
|
@ -217,8 +217,7 @@ SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, int speed)
|
|||
min = 2;
|
||||
firstlast = 0;
|
||||
mode.doingslide = 1;
|
||||
ApplySclass(FindItem
|
||||
("SOUND_WINDOW_SLIDE", 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS));
|
||||
SoundPlay("SOUND_WINDOW_SLIDE");
|
||||
|
||||
if (mode.slidemode > 0)
|
||||
GrabX();
|
||||
|
@ -258,9 +257,7 @@ SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, int speed)
|
|||
mode.doingslide = 0;
|
||||
if (mode.slidemode > 0)
|
||||
UngrabX();
|
||||
ApplySclass(FindItem
|
||||
("SOUND_WINDOW_SLIDE_END", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_SCLASS));
|
||||
SoundPlay("SOUND_WINDOW_SLIDE_END");
|
||||
EDBUG_RETURN_;
|
||||
}
|
||||
|
||||
|
@ -286,8 +283,7 @@ SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty, int num_wins,
|
|||
min = 2;
|
||||
firstlast = 0;
|
||||
mode.doingslide = 1;
|
||||
ApplySclass(FindItem
|
||||
("SOUND_WINDOW_SLIDE", 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS));
|
||||
SoundPlay("SOUND_WINDOW_SLIDE");
|
||||
if (mode.slidemode > 0)
|
||||
GrabX();
|
||||
for (k = 0; k <= 1024; k += spd)
|
||||
|
@ -340,9 +336,7 @@ SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty, int num_wins,
|
|||
mode.doingslide = 0;
|
||||
if (mode.slidemode > 0)
|
||||
UngrabX();
|
||||
ApplySclass(FindItem
|
||||
("SOUND_WINDOW_SLIDE_END", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_SCLASS));
|
||||
SoundPlay("SOUND_WINDOW_SLIDE_END");
|
||||
if (x)
|
||||
Efree(x);
|
||||
if (y)
|
||||
|
|
|
@ -1267,8 +1267,10 @@ HandleComms(XClientMessageEvent * ev)
|
|||
{
|
||||
word(s, wd, w);
|
||||
mode.sound = atoi(w);
|
||||
if ((mode.sound) && (sound_fd < 0))
|
||||
if (mode.sound)
|
||||
SoundInit();
|
||||
else
|
||||
SoundExit();
|
||||
}
|
||||
else if (!strcmp(w, "BUTTONMOVERESISTANCE:"))
|
||||
{
|
||||
|
@ -2061,7 +2063,7 @@ HandleComms(XClientMessageEvent * ev)
|
|||
_("Received Unknown Client Message.\n"
|
||||
"Client Name: %s\n" "Client Version: %s\n"
|
||||
"Message Contents:\n\n" "%s\n"), s1, s2, s);
|
||||
AUDIO_PLAY("SOUND_ERROR_IPC");
|
||||
SoundPlay("SOUND_ERROR_IPC");
|
||||
}
|
||||
}
|
||||
Efree(s);
|
||||
|
|
|
@ -1035,7 +1035,7 @@ Config_Menu(FILE * ConfigFile)
|
|||
|
||||
if (ms)
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SCANNING");
|
||||
SoundPlay("SOUND_SCANNING");
|
||||
m = MenuCreateFromDirectory(s2, ms, s5);
|
||||
ms->ref_count++;
|
||||
}
|
||||
|
@ -2061,8 +2061,7 @@ Config_Sound(FILE * ConfigFile)
|
|||
else if (ret == 2)
|
||||
{
|
||||
sscanf(s, "%4000s %4000s", s1, s2);
|
||||
sc = CreateSoundClass(s1, s2);
|
||||
AddItem(sc, sc->name, 0, LIST_TYPE_SCLASS);
|
||||
sc = SclassCreate(s1, s2);
|
||||
}
|
||||
}
|
||||
Alert(_
|
||||
|
|
|
@ -254,8 +254,7 @@ static void
|
|||
HButtonPress(XEvent * ev)
|
||||
{
|
||||
EDBUG(7, "HButtonPress");
|
||||
ApplySclass(FindItem
|
||||
("SOUND_BUTTON_CLICK", 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS));
|
||||
SoundPlay("SOUND_BUTTON_CLICK");
|
||||
HandleMouseDown(ev);
|
||||
#if 0
|
||||
{
|
||||
|
@ -317,8 +316,7 @@ static void
|
|||
HButtonRelease(XEvent * ev)
|
||||
{
|
||||
EDBUG(7, "HButtonRelease");
|
||||
ApplySclass(FindItem
|
||||
("SOUND_BUTTON_RAISE", 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS));
|
||||
SoundPlay("SOUND_BUTTON_RAISE");
|
||||
HandleMouseUp(ev);
|
||||
EDBUG_RETURN_;
|
||||
}
|
||||
|
|
|
@ -322,7 +322,7 @@ FocusToEWin(EWin * ewin)
|
|||
{
|
||||
CalcEwinSizes(mode.focuswin);
|
||||
DrawEwin(mode.focuswin);
|
||||
AUDIO_PLAY("SOUND_FOCUS_SET");
|
||||
SoundPlay("SOUND_FOCUS_SET");
|
||||
ICCCM_Focus(mode.focuswin);
|
||||
}
|
||||
/* ReZoom(mode.focuswin); */
|
||||
|
|
|
@ -58,7 +58,6 @@ Window init_win2 = 0;
|
|||
Window init_win_ext = 0;
|
||||
Window bpress_win = 0;
|
||||
int deskorder[ENLIGHTENMENT_CONF_NUM_DESKTOPS];
|
||||
int sound_fd = -1;
|
||||
char themepath[FILEPATH_LEN_MAX];
|
||||
char themename[FILEPATH_LEN_MAX];
|
||||
char *command;
|
||||
|
|
|
@ -848,9 +848,6 @@ GNOME_ProcessClientMessage(XClientMessageEvent * event)
|
|||
ewin->sticky = 1;
|
||||
RaiseEwin(ewin);
|
||||
DrawEwin(ewin);
|
||||
ApplySclass(FindItem
|
||||
("SOUND_WINDOW_STICK", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_SCLASS));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -860,9 +857,6 @@ GNOME_ProcessClientMessage(XClientMessageEvent * event)
|
|||
ewin->sticky = 0;
|
||||
RaiseEwin(ewin);
|
||||
DrawEwin(ewin);
|
||||
ApplySclass(FindItem
|
||||
("SOUND_WINDOW_UNSTICK", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_SCLASS));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -620,10 +620,10 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
|
|||
|
||||
if ((d = FindItem("GROUP_SELECTION", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("GROUP_SETTINGS_ACTIVE");
|
||||
SoundPlay("GROUP_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_GROUP");
|
||||
SoundPlay("SOUND_SETTINGS_GROUP");
|
||||
|
||||
d = DialogCreate("GROUP_SELECTION");
|
||||
DialogSetTitle(d, _("Window Group Selection"));
|
||||
|
|
|
@ -217,7 +217,7 @@ IconboxIconifyEwin(Iconbox * ib, EWin * ewin)
|
|||
if (!ewin->iconified)
|
||||
{
|
||||
was_shaded = ewin->shaded;
|
||||
AUDIO_PLAY("SOUND_ICONIFY");
|
||||
SoundPlay("SOUND_ICONIFY");
|
||||
if (ib)
|
||||
{
|
||||
if (ib->animate)
|
||||
|
@ -311,7 +311,7 @@ DeIconifyEwin(EWin * ewin)
|
|||
else
|
||||
MoveEwin(ewin, ewin->x + dx, ewin->y + dy);
|
||||
|
||||
AUDIO_PLAY("SOUND_DEICONIFY");
|
||||
SoundPlay("SOUND_DEICONIFY");
|
||||
if (ib)
|
||||
{
|
||||
if (ib->animate)
|
||||
|
|
43
src/ipc.c
43
src/ipc.c
|
@ -1972,9 +1972,7 @@ IPC_SoundClass(char *params, Client * c)
|
|||
word(params, 3, param3);
|
||||
if (param3[0])
|
||||
{
|
||||
sc = CreateSoundClass(param1, param2);
|
||||
if (sc)
|
||||
AddItem(sc, sc->name, 0, LIST_TYPE_SCLASS);
|
||||
sc = SclassCreate(param1, param2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1983,9 +1981,7 @@ IPC_SoundClass(char *params, Client * c)
|
|||
}
|
||||
else if (!strcmp(param1, "delete"))
|
||||
{
|
||||
DestroySclass(RemoveItem
|
||||
(param2, 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_SCLASS));
|
||||
SoundFree((char *)param2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2016,12 +2012,7 @@ IPC_PlaySoundClass(char *params, Client * c)
|
|||
|
||||
if (params)
|
||||
{
|
||||
SoundClass *soundtoplay;
|
||||
|
||||
soundtoplay = FindItem(params, 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS);
|
||||
if (soundtoplay)
|
||||
ApplySclass(soundtoplay);
|
||||
else
|
||||
if (SoundPlay((char *)params))
|
||||
Esnprintf(buf, sizeof(buf), "Error: unknown soundclass selected");
|
||||
}
|
||||
else
|
||||
|
@ -2093,7 +2084,7 @@ IPC_ListClassMembers(char *params, Client * c)
|
|||
for (i = 0; i < num; i++)
|
||||
{
|
||||
buf2[0] = 0;
|
||||
Esnprintf(buf2, sizeof(buf2), "%s\n", lst[i]->name);
|
||||
Esnprintf(buf2, sizeof(buf2), "%s\n", SclassGetName(lst[i]));
|
||||
if (buf)
|
||||
buf = realloc(buf, strlen(buf) + strlen(buf2) + 1);
|
||||
else
|
||||
|
@ -3522,26 +3513,8 @@ IPC_FX(char *params, Client * c)
|
|||
{
|
||||
if (mode.sound)
|
||||
{
|
||||
|
||||
SoundClass **lst;
|
||||
int num, i;
|
||||
|
||||
mode.sound = 0;
|
||||
|
||||
lst =
|
||||
(SoundClass **) ListItemType(&num, LIST_TYPE_SCLASS);
|
||||
if (lst)
|
||||
{
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
if (lst[i]->sample)
|
||||
DestroySample(lst[i]->sample);
|
||||
lst[i]->sample = NULL;
|
||||
}
|
||||
Efree(lst);
|
||||
}
|
||||
close(sound_fd);
|
||||
sound_fd = -1;
|
||||
SoundExit();
|
||||
}
|
||||
}
|
||||
else if (!strcmp(word2, "?"))
|
||||
|
@ -3831,14 +3804,12 @@ IPC_WinOps(char *params, Client * c)
|
|||
if (!strncmp(operation, "close", 2))
|
||||
{
|
||||
ICCCM_Delete(ewin);
|
||||
ApplySclass(FindItem("SOUND_WINDOW_CLOSE", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_SCLASS));
|
||||
SoundPlay("SOUND_WINDOW_CLOSE");
|
||||
}
|
||||
else if (!strncmp(operation, "annihiliate", 2))
|
||||
{
|
||||
EDestroyWindow(disp, ewin->client.win);
|
||||
ApplySclass(FindItem("SOUND_WINDOW_CLOSE", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_SCLASS));
|
||||
SoundPlay("SOUND_WINDOW_CLOSE");
|
||||
}
|
||||
else if (!strncmp(operation, "iconify", 2))
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "E.h"
|
||||
|
||||
void *
|
||||
FindItem(char *name, int id, int find_by, int type)
|
||||
FindItem(const char *name, int id, int find_by, int type)
|
||||
{
|
||||
List *ptr;
|
||||
|
||||
|
@ -76,7 +76,7 @@ FindItem(char *name, int id, int find_by, int type)
|
|||
}
|
||||
|
||||
void
|
||||
AddItem(void *item, char *name, int id, int type)
|
||||
AddItem(void *item, const char *name, int id, int type)
|
||||
{
|
||||
List *ptr;
|
||||
|
||||
|
@ -93,7 +93,7 @@ AddItem(void *item, char *name, int id, int type)
|
|||
}
|
||||
|
||||
void
|
||||
AddItemEnd(void *item, char *name, int id, int type)
|
||||
AddItemEnd(void *item, const char *name, int id, int type)
|
||||
{
|
||||
List *ptr, *p;
|
||||
|
||||
|
@ -197,7 +197,7 @@ MoveItemToListBottom(void *item, int type)
|
|||
}
|
||||
|
||||
void *
|
||||
RemoveItem(char *name, int id, int find_by, int type)
|
||||
RemoveItem(const char *name, int id, int find_by, int type)
|
||||
{
|
||||
List *ptr, *pptr;
|
||||
void *p;
|
||||
|
|
|
@ -256,10 +256,8 @@ main(int argc, char **argv)
|
|||
RefreshDesktop(0);
|
||||
if (mode.sound)
|
||||
{
|
||||
ApplySclass(FindItem("SOUND_STARTUP", 0,
|
||||
LIST_FINDBY_NAME, LIST_TYPE_SCLASS));
|
||||
DestroySclass(RemoveItem("SOUND_STARTUP", 0,
|
||||
LIST_FINDBY_NAME, LIST_TYPE_SCLASS));
|
||||
SoundPlay("SOUND_STARTUP");
|
||||
SoundFree("SOUND_STARTUP");
|
||||
}
|
||||
/* toss down the dragbar and related */
|
||||
InitDesktopControls();
|
||||
|
|
|
@ -1701,7 +1701,7 @@ PagersEventMouseUp(XEvent * ev)
|
|||
GotoDesktop(p->desktop);
|
||||
if (p->desktop != desks.current)
|
||||
{
|
||||
AUDIO_PLAY("SOUND_DESKTOP_SHUT");
|
||||
SoundPlay("SOUND_DESKTOP_SHUT");
|
||||
}
|
||||
SetCurrentArea(pax, pay);
|
||||
}
|
||||
|
|
|
@ -539,7 +539,7 @@ doSMExit(void *params)
|
|||
}
|
||||
if (!strcmp(s, "restart"))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_WAIT");
|
||||
SoundPlay("SOUND_WAIT");
|
||||
if (sound_fd >= 0)
|
||||
close(sound_fd);
|
||||
w = MakeExtInitWin();
|
||||
|
@ -565,7 +565,7 @@ doSMExit(void *params)
|
|||
}
|
||||
else if (!strcmp(s, "restart_theme"))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_WAIT");
|
||||
SoundPlay("SOUND_WAIT");
|
||||
if (sound_fd >= 0)
|
||||
close(sound_fd);
|
||||
w = MakeExtInitWin();
|
||||
|
@ -580,7 +580,7 @@ doSMExit(void *params)
|
|||
}
|
||||
else if (!strcmp(s, "restart_wm"))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_EXIT");
|
||||
SoundPlay("SOUND_EXIT");
|
||||
if (sound_fd >= 0)
|
||||
close(sound_fd);
|
||||
XCloseDisplay(disp);
|
||||
|
@ -604,7 +604,7 @@ doSMExit(void *params)
|
|||
FindItem("LOGOUT_DIALOG", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_LOGOUT");
|
||||
SoundPlay("SOUND_LOGOUT");
|
||||
d = DialogCreate("LOGOUT_DIALOG");
|
||||
DialogSetTitle(d, "Are you sure?");
|
||||
DialogSetText(d,
|
||||
|
@ -626,7 +626,7 @@ doSMExit(void *params)
|
|||
}
|
||||
}
|
||||
|
||||
AUDIO_PLAY("SOUND_EXIT");
|
||||
SoundPlay("SOUND_EXIT");
|
||||
EExit(0);
|
||||
}
|
||||
|
||||
|
@ -904,8 +904,7 @@ static void
|
|||
callback_die(SmcConn smc_conn, SmPointer client_data)
|
||||
{
|
||||
if (master_pid == getpid())
|
||||
ApplySclass(FindItem
|
||||
("SOUND_EXIT", 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS));
|
||||
SoundPlay("SOUND_EXIT");
|
||||
EExit(0);
|
||||
smc_conn = 0;
|
||||
client_data = NULL;
|
||||
|
@ -1156,7 +1155,7 @@ doSMExit(void *params)
|
|||
(d =
|
||||
FindItem("LOGOUT_DIALOG", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_LOGOUT");
|
||||
SoundPlay("SOUND_LOGOUT");
|
||||
d = DialogCreate("LOGOUT_DIALOG");
|
||||
DialogSetTitle(d, _("Are you sure?"));
|
||||
DialogSetText(d,
|
||||
|
@ -1178,7 +1177,7 @@ doSMExit(void *params)
|
|||
}
|
||||
else if (!strcmp(s, "restart_wm"))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_WAIT");
|
||||
SoundPlay("SOUND_WAIT");
|
||||
XCloseDisplay(disp);
|
||||
disp = NULL;
|
||||
Esnprintf(s, sizeof(s), "exec %s", atword(params, 2));
|
||||
|
@ -1186,7 +1185,7 @@ doSMExit(void *params)
|
|||
}
|
||||
else if (!strcmp(s, "restart"))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_WAIT");
|
||||
SoundPlay("SOUND_WAIT");
|
||||
if (disp)
|
||||
init_win_ext = MakeExtInitWin();
|
||||
|
||||
|
@ -1232,7 +1231,7 @@ doSMExit(void *params)
|
|||
}
|
||||
else if (!strcmp((char *)s, "restart_theme"))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_WAIT");
|
||||
SoundPlay("SOUND_WAIT");
|
||||
init_win_ext = MakeExtInitWin();
|
||||
if (atword(params, 1) && strlen((char *)params) < 1024)
|
||||
{
|
||||
|
@ -1266,7 +1265,7 @@ doSMExit(void *params)
|
|||
|
||||
restarting = False;
|
||||
SaveSession(1);
|
||||
AUDIO_PLAY("SOUND_EXIT");
|
||||
SoundPlay("SOUND_EXIT");
|
||||
EExit(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -103,11 +103,11 @@ SettingsPager(void)
|
|||
|
||||
if ((d = FindItem("CONFIGURE_PAGER", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_PAGER");
|
||||
SoundPlay("SOUND_SETTINGS_PAGER");
|
||||
|
||||
tmp_show_pagers = mode.show_pagers;
|
||||
tmp_pager_hiq = mode.pager_hiq;
|
||||
|
@ -390,11 +390,11 @@ SettingsFocus(void)
|
|||
|
||||
if ((d = FindItem("CONFIGURE_FOCUS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_FOCUS");
|
||||
SoundPlay("SOUND_SETTINGS_FOCUS");
|
||||
|
||||
tmp_focus = mode.focusmode;
|
||||
tmp_new_focus = mode.all_new_windows_get_focus;
|
||||
|
@ -788,11 +788,11 @@ SettingsMoveResize(void)
|
|||
FindItem("CONFIGURE_MOVERESIZE", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_MOVERESIZE");
|
||||
SoundPlay("SOUND_SETTINGS_MOVERESIZE");
|
||||
|
||||
tmp_move = mode.movemode;
|
||||
tmp_resize = mode.resizemode;
|
||||
|
@ -1109,11 +1109,11 @@ SettingsDesktops(void)
|
|||
if ((d =
|
||||
FindItem("CONFIGURE_DESKTOPS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_DESKTOPS");
|
||||
SoundPlay("SOUND_SETTINGS_DESKTOPS");
|
||||
|
||||
tmp_desktops = mode.numdesktops;
|
||||
tmp_desktop_wraparound = mode.desktop_wraparound;
|
||||
|
@ -1303,11 +1303,11 @@ SettingsArea(void)
|
|||
|
||||
if ((d = FindItem("CONFIGURE_AREA", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_AREA");
|
||||
SoundPlay("SOUND_SETTINGS_AREA");
|
||||
|
||||
tmp_area_wraparound = mode.area_wraparound;
|
||||
tmp_edge_resist = mode.edge_flip_resistance;
|
||||
|
@ -1482,11 +1482,11 @@ SettingsPlacement(void)
|
|||
if ((d =
|
||||
FindItem("CONFIGURE_PLACEMENT", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_PLACEMENT");
|
||||
SoundPlay("SOUND_SETTINGS_PLACEMENT");
|
||||
|
||||
tmp_with_leader = mode.transientsfollowleader;
|
||||
tmp_switch_popup = mode.switchfortransientmap;
|
||||
|
@ -1617,11 +1617,11 @@ SettingsAutoRaise(void)
|
|||
if ((d =
|
||||
FindItem("CONFIGURE_AUTORAISE", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_AUTORAISE");
|
||||
SoundPlay("SOUND_SETTINGS_AUTORAISE");
|
||||
|
||||
tmp_autoraise = mode.autoraise;
|
||||
tmp_autoraisetime = (int)(mode.autoraisetime * 100);
|
||||
|
@ -1717,11 +1717,11 @@ SettingsTooltips(void)
|
|||
if ((d =
|
||||
FindItem("CONFIGURE_TOOLTIPS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_TOOLTIPS");
|
||||
SoundPlay("SOUND_SETTINGS_TOOLTIPS");
|
||||
|
||||
tmp_tooltips = mode.tooltips;
|
||||
tmp_tooltiptime = (int)(mode.tiptime * 100);
|
||||
|
@ -1821,11 +1821,11 @@ SettingsMiscellaneous(void)
|
|||
FindItem("CONFIGURE_MISCELLANEOUS", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_MISCELLANEOUS");
|
||||
SoundPlay("SOUND_SETTINGS_MISCELLANEOUS");
|
||||
|
||||
tmp_dialog_headers = mode.dialog_headers;
|
||||
|
||||
|
@ -1887,9 +1887,9 @@ CB_ConfigureAudio(int val, void *data)
|
|||
if (val < 2)
|
||||
{
|
||||
mode.sound = tmp_audio;
|
||||
if ((mode.sound) && (sound_fd < 0))
|
||||
if (mode.sound)
|
||||
SoundInit();
|
||||
else if ((!mode.sound) && (sound_fd >= 0))
|
||||
else
|
||||
SoundExit();
|
||||
}
|
||||
autosave();
|
||||
|
@ -1904,11 +1904,11 @@ SettingsAudio(void)
|
|||
|
||||
if ((d = FindItem("CONFIGURE_AUDIO", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_AUDIO");
|
||||
SoundPlay("SOUND_SETTINGS_AUDIO");
|
||||
|
||||
tmp_audio = mode.sound;
|
||||
|
||||
|
@ -2043,11 +2043,11 @@ SettingsSpecialFX(void)
|
|||
|
||||
if ((d = FindItem("CONFIGURE_FX", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_FX");
|
||||
SoundPlay("SOUND_SETTINGS_FX");
|
||||
|
||||
tmp_saveunders = mode.save_under;
|
||||
tmp_warpmenus = mode.warpmenus;
|
||||
|
@ -2961,7 +2961,7 @@ CB_BGScan(int val, void *data)
|
|||
{
|
||||
int slider, lower, upper;
|
||||
|
||||
AUDIO_PLAY("SOUND_WAIT");
|
||||
SoundPlay("SOUND_WAIT");
|
||||
|
||||
DialogItemSliderGetBounds(bg_sel_slider, &lower, &upper);
|
||||
|
||||
|
@ -3265,11 +3265,11 @@ SettingsBackground(Background * bg)
|
|||
|
||||
if ((d = FindItem("CONFIGURE_BG", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_BG");
|
||||
SoundPlay("SOUND_SETTINGS_BG");
|
||||
|
||||
if ((!bg) || ((bg) && (!strcmp(bg->name, "NONE"))))
|
||||
{
|
||||
|
@ -3742,11 +3742,11 @@ SettingsIconbox(char *name)
|
|||
if ((d =
|
||||
FindItem("CONFIGURE_ICONBOX", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ICONBOX");
|
||||
SoundPlay("SOUND_SETTINGS_ICONBOX");
|
||||
|
||||
if (!name)
|
||||
return;
|
||||
|
@ -4150,11 +4150,11 @@ SettingsGroups(EWin * ewin)
|
|||
}
|
||||
if ((d = FindItem("CONFIGURE_GROUP", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("GROUP_SETTINGS_ACTIVE");
|
||||
SoundPlay("GROUP_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_GROUP");
|
||||
SoundPlay("SOUND_SETTINGS_GROUP");
|
||||
|
||||
tmp_ewin = ewin;
|
||||
tmp_groups = ewin->groups;
|
||||
|
@ -4362,11 +4362,11 @@ SettingsDefaultGroupControl(void)
|
|||
FindItem("CONFIGURE_DEFAULT_GROUP_CONTROL", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_GROUP");
|
||||
SoundPlay("SOUND_SETTINGS_GROUP");
|
||||
|
||||
CopyGroupConfig(&(mode.group_config), &tmp_group_cfg);
|
||||
tmp_group_swap = mode.group_swapmove;
|
||||
|
@ -4613,11 +4613,11 @@ SettingsRemember()
|
|||
/* init remember window */
|
||||
if ((d = FindItem("REMEMBER_WINDOW", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
{
|
||||
AUDIO_PLAY("SOUND_SETTINGS_ACTIVE");
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
return;
|
||||
}
|
||||
AUDIO_PLAY("SOUND_SETTINGS_REMEMBER");
|
||||
SoundPlay("SOUND_SETTINGS_REMEMBER");
|
||||
|
||||
d = DialogCreate("REMEMBER_WINDOW");
|
||||
DialogSetTitle(d, _("Remembered Windows Settings"));
|
||||
|
|
160
src/sound.c
160
src/sound.c
|
@ -32,7 +32,27 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
Sample *
|
||||
typedef struct
|
||||
{
|
||||
char *file;
|
||||
int rate;
|
||||
int format;
|
||||
int samples;
|
||||
unsigned char *data;
|
||||
int id;
|
||||
} Sample;
|
||||
|
||||
struct _soundclass
|
||||
{
|
||||
char *name;
|
||||
char *file;
|
||||
Sample *sample;
|
||||
unsigned int ref_count;
|
||||
};
|
||||
|
||||
static int sound_fd = -1;
|
||||
|
||||
static Sample *
|
||||
LoadWav(char *file)
|
||||
{
|
||||
#ifdef HAVE_LIBESD
|
||||
|
@ -110,15 +130,14 @@ LoadWav(char *file)
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
SoundPlay(Sample * s)
|
||||
static void
|
||||
SamplePlay(Sample * s)
|
||||
{
|
||||
#ifdef HAVE_LIBESD
|
||||
int size, confirm = 0;
|
||||
|
||||
#endif
|
||||
|
||||
EDBUG(5, "SoundPlay");
|
||||
EDBUG(5, "SamplePlay");
|
||||
#ifdef HAVE_LIBESD
|
||||
if ((sound_fd < 0) || (!mode.sound) || (!s))
|
||||
EDBUG_RETURN_;
|
||||
|
@ -147,58 +166,13 @@ SoundPlay(Sample * s)
|
|||
}
|
||||
if (s->id > 0)
|
||||
esd_sample_play(sound_fd, s->id);
|
||||
EDBUG_RETURN_;
|
||||
#else
|
||||
s = NULL;
|
||||
EDBUG_RETURN_;
|
||||
#endif
|
||||
EDBUG_RETURN_;
|
||||
}
|
||||
|
||||
SoundClass *
|
||||
CreateSoundClass(char *name, char *file)
|
||||
{
|
||||
SoundClass *sclass;
|
||||
|
||||
EDBUG(6, "CreateSoundClass");
|
||||
sclass = Emalloc(sizeof(SoundClass));
|
||||
if (!sclass)
|
||||
EDBUG_RETURN(NULL);
|
||||
sclass->name = duplicate(name);
|
||||
sclass->file = duplicate(file);
|
||||
sclass->sample = NULL;
|
||||
EDBUG_RETURN(sclass);
|
||||
}
|
||||
|
||||
void
|
||||
ApplySclass(SoundClass * sclass)
|
||||
{
|
||||
#ifdef HAVE_LIBESD
|
||||
char *f;
|
||||
|
||||
#endif
|
||||
|
||||
EDBUG(4, "ApplySclass");
|
||||
if (!sclass)
|
||||
EDBUG_RETURN_;
|
||||
#ifdef HAVE_LIBESD
|
||||
if ((!sclass->sample) && (mode.sound))
|
||||
{
|
||||
f = FindFile(sclass->file);
|
||||
if (f)
|
||||
{
|
||||
sclass->sample = LoadWav(f);
|
||||
Efree(f);
|
||||
}
|
||||
}
|
||||
if ((mode.sound) && (sclass->sample))
|
||||
SoundPlay(sclass->sample);
|
||||
EDBUG_RETURN_;
|
||||
#else
|
||||
EDBUG_RETURN_;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
DestroySample(Sample * s)
|
||||
{
|
||||
EDBUG(5, "DestroySample");
|
||||
|
@ -221,13 +195,55 @@ DestroySample(Sample * s)
|
|||
EDBUG_RETURN_;
|
||||
}
|
||||
|
||||
void
|
||||
DestroySclass(SoundClass * sclass)
|
||||
SoundClass *
|
||||
SclassCreate(const char *name, const char *file)
|
||||
{
|
||||
SoundClass *sclass;
|
||||
|
||||
EDBUG(6, "SclassCreate");
|
||||
sclass = Emalloc(sizeof(SoundClass));
|
||||
if (!sclass)
|
||||
EDBUG_RETURN(NULL);
|
||||
sclass->name = duplicate(name);
|
||||
sclass->file = duplicate(file);
|
||||
sclass->sample = NULL;
|
||||
AddItem(sclass, sclass->name, 0, LIST_TYPE_SCLASS);
|
||||
EDBUG_RETURN(sclass);
|
||||
}
|
||||
|
||||
void
|
||||
SclassApply(SoundClass * sclass)
|
||||
{
|
||||
#ifdef HAVE_LIBESD
|
||||
char *f;
|
||||
#endif
|
||||
|
||||
EDBUG(4, "SclassApply");
|
||||
if (!sclass)
|
||||
EDBUG_RETURN_;
|
||||
#ifdef HAVE_LIBESD
|
||||
if ((!sclass->sample) && (mode.sound))
|
||||
{
|
||||
f = FindFile(sclass->file);
|
||||
if (f)
|
||||
{
|
||||
sclass->sample = LoadWav(f);
|
||||
Efree(f);
|
||||
}
|
||||
}
|
||||
if ((mode.sound) && (sclass->sample))
|
||||
SamplePlay(sclass->sample);
|
||||
#endif
|
||||
EDBUG_RETURN_;
|
||||
}
|
||||
|
||||
EDBUG(5, "DestroySclass");
|
||||
void
|
||||
SclassDestroy(SoundClass * sclass)
|
||||
{
|
||||
EDBUG(5, "SclassDestroy");
|
||||
if (!sclass)
|
||||
EDBUG_RETURN_;
|
||||
RemoveItem(sclass->name, 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS);
|
||||
if (sclass->name)
|
||||
Efree(sclass->name);
|
||||
if (sclass->file)
|
||||
|
@ -238,12 +254,37 @@ DestroySclass(SoundClass * sclass)
|
|||
EDBUG_RETURN_;
|
||||
}
|
||||
|
||||
const char *
|
||||
SclassGetName(SoundClass * sclass)
|
||||
{
|
||||
return sclass->name;
|
||||
}
|
||||
|
||||
int
|
||||
SoundPlay(const char *name)
|
||||
{
|
||||
SoundClass *sclass;
|
||||
|
||||
sclass = FindItem(name, 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS);
|
||||
SclassApply(sclass);
|
||||
return sclass != NULL;
|
||||
}
|
||||
|
||||
int
|
||||
SoundFree(const char *name)
|
||||
{
|
||||
SoundClass *sclass;
|
||||
|
||||
sclass = FindItem(name, 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS);
|
||||
SclassDestroy(sclass);
|
||||
return sclass != NULL;
|
||||
}
|
||||
|
||||
void
|
||||
SoundInit()
|
||||
SoundInit(void)
|
||||
{
|
||||
#ifdef HAVE_LIBESD
|
||||
int fd;
|
||||
|
||||
#endif
|
||||
|
||||
EDBUG(5, "SoundInit");
|
||||
|
@ -265,15 +306,14 @@ SoundInit()
|
|||
RESET_ALERT;
|
||||
mode.sound = 0;
|
||||
}
|
||||
EDBUG_RETURN_;
|
||||
#else
|
||||
mode.sound = 0;
|
||||
EDBUG_RETURN_;
|
||||
#endif
|
||||
EDBUG_RETURN_;
|
||||
}
|
||||
|
||||
void
|
||||
SoundExit()
|
||||
SoundExit(void)
|
||||
{
|
||||
SoundClass **lst;
|
||||
int num, i;
|
||||
|
|
|
@ -41,8 +41,7 @@ MakeWindowUnSticky(EWin * ewin)
|
|||
|
||||
HintsSetWindowState(ewin);
|
||||
|
||||
ApplySclass(FindItem
|
||||
("SOUND_WINDOW_UNSTICK", 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS));
|
||||
SoundPlay("SOUND_WINDOW_UNSTICK");
|
||||
|
||||
EDBUG_RETURN_;
|
||||
}
|
||||
|
@ -84,8 +83,7 @@ MakeWindowSticky(EWin * ewin)
|
|||
|
||||
HintsSetWindowState(ewin);
|
||||
|
||||
ApplySclass(FindItem
|
||||
("SOUND_WINDOW_STICK", 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS));
|
||||
SoundPlay("SOUND_WINDOW_STICK");
|
||||
|
||||
EDBUG_RETURN_;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue