~ubuntu-branches/ubuntu/oneiric/rhythmbox/oneiric

« back to all changes in this revision

Viewing changes to lib/libmediaplayerid/testmpid.c

  • Committer: Bazaar Package Importer
  • Author(s): Rico Tzschichholz
  • Date: 2011-07-29 16:41:38 UTC
  • mto: This revision was merged to the branch mainline in revision 191.
  • Revision ID: james.westby@ubuntu.com-20110729164138-wwicy8nqalm18ck7
Tags: upstream-2.90.1~20110802
ImportĀ upstreamĀ versionĀ 2.90.1~20110802

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2009 Jonathan Matthew  <jonathan@d14n.org>
3
 
 *
4
 
 * This library is free software; you can redistribute it and/or
5
 
 * modify it under the terms of the GNU Lesser General Public
6
 
 * License as published by the Free Software Foundation; either
7
 
 * version 2 of the License, or (at your option) any later version.
8
 
 *
9
 
 * This library is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 
 * Lesser General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU Lesser General Public
15
 
 * License along with this library; if not, write to the
16
 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
 
 * Boston, MA 02111-1307, USA.
18
 
 */
19
 
 
20
 
#include "mediaplayerid.h"
21
 
 
22
 
int
23
 
main (int argc, char **argv)
24
 
{
25
 
        MPIDDevice *device;
26
 
 
27
 
        g_type_init ();
28
 
 
29
 
        mpid_enable_debug (TRUE);
30
 
        device = mpid_device_new (argv[1]);
31
 
 
32
 
        switch (device->error) {
33
 
        case MPID_ERROR_NONE:
34
 
                break;
35
 
        case MPID_ERROR_NO_DEVICE_PATH:
36
 
                g_print ("unable to get device path\n");
37
 
                break;
38
 
        case MPID_ERROR_MECHANISM_FAILED:
39
 
                g_print ("device database mechanism failed\n");
40
 
                break;
41
 
        case MPID_ERROR_NOT_MEDIA_PLAYER:
42
 
                g_print ("device is not a media player\n");
43
 
                break;
44
 
        case MPID_ERROR_DEVICE_INFO_MISSING:
45
 
                g_print ("device info is missing from database\n");
46
 
                break;
47
 
        }
48
 
 
49
 
        g_object_unref (device);
50
 
        return 0;
51
 
}
52