2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
11 #include "camd_intern.h"
13 /*****************************************************************************
17 AROS_LH1(struct MidiCluster
*, NextCluster
,
20 AROS_LHA(struct MidiCluster
*, last
, A0
),
23 struct CamdBase
*, CamdBase
, 21, Camd
)
26 Finds the next cluster in camds list of clusters.
29 last - cluster to start searching for.
32 Next cluster in list, or first if 'last' is NULL.
35 - CL_Linkages must be locked.
37 - Often, a program wants to use this function for finding available
38 clusters a user can choose from. It is then recommended to also
39 let the user have the possibility to write in the name of a new cluster,
40 so that camd can make new clusters automatically to be used for
41 communication between various applications without having hardware-drivers
42 etc. interfere with the datastreams. Applications do
43 not need to make special concerns about how cluster works or
44 what they contain; that is all managed by camd.
49 #include <proto/exec.h>
50 #include <proto/camd.h>
51 #include <midi/camd.h>
56 struct MidiCluster *cluster;
58 struct Library *CamdBase=OpenLibrary("camd.library",0L);
61 lock=LockCAMD(CD_Linkages);
63 cluster=NextCluster(NULL);
66 printf("No clusters available.\n");
71 printf("clustername: -%s-\n",cluster->mcl_Node.ln_Name);
72 cluster=NextCluster(cluster);
73 }while(cluster!=NULL);
78 CloseLibrary(CamdBase);
81 printf("Could not open camd.library.\n");
92 NextMidiLink(), NextMidi(), FindCluster()
98 2001-01-12 ksvalast first created
100 *****************************************************************************/
105 if(IsListEmpty(&CB(CamdBase
)->midiclusters
)){
108 return (struct MidiCluster
*)CB(CamdBase
)->midiclusters
.lh_Head
;
110 if(last
->mcl_Node
.ln_Succ
->ln_Succ
==NULL
) return NULL
;
112 return (struct MidiCluster
*)last
->mcl_Node
.ln_Succ
;