root/trunk/libffado/src/ser.cpp

Revision 516, 1.7 kB (checked in by wagi, 17 years ago)

- some de/serialing bugs found and fixed
- caching enabled for bebob devices

(finally online again! big thanks to my free wireless internet provider. s/he is finally back from
her/his holiday :)

Line 
1 /*
2  * Copyright (C) 2005-2007 by Daniel Wagner
3  *
4  * This file is part of FFADO
5  * FFADO = Free Firewire (pro-)audio drivers for linux
6  *
7  * FFADO is based upon FreeBoB.
8  *
9  * This is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2
11  * as published by the Free Software Foundation.
12  *
13  * FFADO is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with FFADO; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  * MA 02111-1307 USA.
22  */
23
24 #include "devicemanager.h"
25 #include "libutil/serialize.h"
26
27 #include <iostream>
28
29 const char FileName[] = "bebob.xml";
30
31 static bool
32 serialize( const char* pFileName )
33 {
34     DeviceManager devMgr;
35     if ( !devMgr.initialize( 0 ) )
36         return false;
37     if ( !devMgr.discover() )
38         return false;
39     devMgr.setVerboseLevel( 4 );
40     return devMgr.buildCache();
41 }
42
43 static bool
44 deserialize( const char* pFileName )
45 {
46     DeviceManager devMgr;
47     if ( !devMgr.initialize( 0 ) )
48         return false;
49
50     devMgr.setVerboseLevel( 4 );
51     //return devMgr.loadCache( pFileName );
52     return false;
53 }
54
55 int
56 main(  int argc,  char** argv )
57 {
58     if ( !serialize( FileName ) ) {
59         std::cerr << "serializing failed" << std::endl;
60         return -1;
61     }
62     if ( !deserialize( FileName ) ) {
63         std::cerr << "deserializing failed" << std::endl;
64         return -1;
65     }
66
67     std::cout << "passed" << std::endl;
68     return 0;
69 }
Note: See TracBrowser for help on using the browser.