Ejemplo n.º 1
0
void Melder_beep () {
	#ifdef macintosh
		AudioServicesPlayAlertSound (kSystemSoundID_UserPreferredAlert);
	#else
		fprintf (stderr, "\a");
	#endif
}
Ejemplo n.º 2
0
// Emit a beeeeeep
void wxBell()
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
    if ( AudioServicesPlayAlertSound != NULL )
        AudioServicesPlayAlertSound(kUserPreferredAlert);
    else
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
        AlertSoundPlay();
#else
    {
    }
#endif
}
Ejemplo n.º 3
0
/* Delayed beep handler */
static int delayed_beep(void *pp) {
	msec_sleep(beep_delay);
	a1logd(g_log,8, "msec_beep activate\n");
#ifdef __APPLE__
# if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
	AudioServicesPlayAlertSound(kUserPreferredAlert);
# else
	SysBeep((beep_msec * 60)/1000);
# endif
#else	/* UNIX */
	/* Linux is pretty lame in this regard... */
	fprintf(stdout, "\a"); fflush(stdout);
#endif 
	return 0;
}
Ejemplo n.º 4
0
int main (int argc, char** argv) {
    // command argument stuff
    int count;
    int delay;
    char* countval = NULL;
    char* delayval = NULL;
    
    // getopt flags
    int c;
    bool n = false;
    bool d = false;
    while ((c = getopt(argc, argv, "d:n:?")) != -1) {
        switch (c) {
            case 'n':
                n = true;
                countval = optarg;
                break;
            case 'd':
                d = true;
                delayval = optarg;
                break;
            case '?':
                usage();
                return 0;
        }
        
    }
    
    if (d) delay = atoi(delayval);
    else   delay = kDefaultVibrateDelay;

    if (n) count = atoi(countval);
    else   count = kDefaultVibrateCount;
    
    for (int i = 0; i < count; i++) {
        AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
        usleep(delay*1000);
    }
    
	return 0;
}
Ejemplo n.º 5
0
/* Activate the system beeper */
void msec_beep(int delay, int freq, int msec) {
	a1logd(g_log,8, "msec_beep %d msec\n",msec);
	if (delay > 0) {
		if (beep_thread != NULL)
			beep_thread->del(beep_thread);
		beep_delay = delay;
		beep_freq = freq;
		beep_msec = msec;
		if ((beep_thread = new_athread(delayed_beep, NULL)) == NULL)
			a1logw(g_log, "msec_beep: Delayed beep failed to create thread\n");
	} else {
		a1logd(g_log,8, "msec_beep activate\n");
#ifdef __APPLE__
# if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
			AudioServicesPlayAlertSound(kUserPreferredAlert);
# else
			SysBeep((msec * 60)/1000);
# endif
#else	/* UNIX */
		fprintf(stdout, "\a"); fflush(stdout);
#endif
	}
}
Ejemplo n.º 6
0
// Emit a beeeeeep
void wxBell()
{
    if ( AudioServicesPlayAlertSound != NULL )
        AudioServicesPlayAlertSound(kUserPreferredAlert);
}