~ubuntu-branches/ubuntu/hardy/alsa-plugins/hardy-proposed

« back to all changes in this revision

Viewing changes to maemo/dsp-protocol.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2007-06-12 19:03:08 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070612190308-yhyjw8t4wk7zhte0
Tags: 1.0.14-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - debian/control:
    + Don't build-depend on JACK, as it's in universe.  Clarify and
      update the Description to note the above restriction and
      {in,ex}clusion of newer plugins (LP: #57089),
    + Adhere to DebianMaintainerField.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @file dsp-protocol.h - Definition of functions whose represents 
 
3
 *                  an interface to the DSP PCM Task node protocol. 
 
4
 * <p>
 
5
 * Copyright (C) 2006 Nokia Corporation
 
6
 * <p>
 
7
 * Contact: Eduardo Bezerra Valentin <eduardo.valentin@indt.org.br>
 
8
 * 
 
9
 * This library is free software; you can redistribute it and/or
 
10
 * modify it under the terms of the GNU Library General Public
 
11
 * License as published by the Free Software Foundation; either
 
12
 * version 2 of the License, or (at your option) any later version.
 
13
 *
 
14
 * This library is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
 * Library General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU Library General Public
 
20
 * License along with this library; if not, write to the
 
21
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
22
 * Boston, MA 02111-1307, USA.
 
23
 * */
 
24
#ifndef _DSP_PROTOCOL_H
 
25
#define _DSP_PROTOCOL_H
 
26
 
 
27
#define __USE_GNU
 
28
#include <features.h>
 
29
#include <pthread.h>
 
30
#include <semaphore.h>
 
31
#include "types.h"
 
32
 
 
33
#ifdef HAVE_CONFIG_H
 
34
#include <config.h>
 
35
#endif
 
36
 
 
37
 
 
38
typedef struct {
 
39
        int fd;
 
40
        char *device;
 
41
        int state;
 
42
        int mute;
 
43
        unsigned int stream_id;
 
44
        unsigned int bridge_buffer_size;        /* in bytes */
 
45
        unsigned int mmap_buffer_size;  /* in bytes */
 
46
        short int *mmap_buffer;
 
47
        pthread_mutex_t mutex;
 
48
        int sem_set_id;
 
49
#ifdef USE_RESOURCE_MANAGER
 
50
        void *dbus_connection;
 
51
#endif
 
52
} dsp_protocol_t;
 
53
/* Initialisation phase */
 
54
int dsp_protocol_create(dsp_protocol_t ** dsp_protocol);
 
55
int dsp_protocol_open_node(dsp_protocol_t * dsp_protocol, const char *device);
 
56
int dsp_protocol_send_audio_params(dsp_protocol_t * dsp_protocol,
 
57
                                   audio_params_data_t * audio_params_data);
 
58
int dsp_protocol_send_speech_params(dsp_protocol_t * dsp_protocol,
 
59
                                    speech_params_data_t * audio_params_data);
 
60
 
 
61
/* Execution phase */
 
62
int dsp_protocol_send_play(dsp_protocol_t * dsp_protocol);
 
63
int dsp_protocol_send_audio_data(dsp_protocol_t * dsp_protocol,
 
64
                                 void *data, unsigned short int count);
 
65
int dsp_protocol_receive_audio_data(dsp_protocol_t * dsp_protocol,
 
66
                                    void *data, int count);
 
67
 
 
68
int dsp_protocol_send_pause(dsp_protocol_t * dsp_protocol);
 
69
int dsp_protocol_send_stop(dsp_protocol_t * dsp_protocol);
 
70
 
 
71
/* Deletion phase */
 
72
int dsp_protocol_close_node(dsp_protocol_t * dsp_protocol);
 
73
int dsp_protocol_destroy(dsp_protocol_t ** dsp_protocol);
 
74
 
 
75
/* controls */
 
76
int dsp_protocol_set_volume(dsp_protocol_t * dsp_protocol,
 
77
                            unsigned char left, unsigned char right);
 
78
int dsp_protocol_get_volume(dsp_protocol_t * dsp_protocol,
 
79
                            unsigned char *left, unsigned char *right);
 
80
int dsp_protocol_set_mute(dsp_protocol_t * dsp_protocol, unsigned char mute);
 
81
int dsp_protocol_get_mute(dsp_protocol_t * dsp_protocol);
 
82
 
 
83
/*miscelaneos*/
 
84
int dsp_protocol_set_mic_enabled(dsp_protocol_t * dsp_protocol, int enabled);
 
85
int dsp_protocol_probe_node(dsp_protocol_t * dsp_protocol, const char *device);
 
86
int safe_strtol(const char *str, long *val);
 
87
 
 
88
#endif                          /* _DSP_PROTOCOL_H */