ZG  "1.00
 All Classes Namespaces Files Functions Variables Enumerator Friends Macros Pages
Classes | Enumerations | Functions | Variables
choir Namespace Reference

The choir namespace contains the code specific to the ZGChoir demonstration application. More...

Classes

class  ChoirSession
 This is the class that that the Choir demo uses to implement its data-replication functionality. More...
 
class  ChoirThread
 This class contains the MUSCLE network I/O thread that has our ChoirSession inside it. More...
 
class  ChoirWindow
 This is the main window of the ZGChoir application. More...
 
class  MusicDatabaseObject
 A slight specialization of the IDatabaseObject class, just so I can add some application-specific helper methods for my various subclasses to all use. More...
 
class  MusicSheet
 This object is the in-memory representation of a song, as a collection of notes over time. More...
 
class  MusicSheetPlayer
 This object is in charge of reading the music sheet and telling Quasimodo when to ring the bells, based on the current time and settings. More...
 
class  MusicSheetWidget
 This widget displays a page of our MusicSheet. More...
 
class  NoteAssignmentsMap
 This object specifies which peers should be playing which notes. More...
 
class  PlaybackState
 This object holds the state of how the currently-in-memory Music sheet should be performed over time. More...
 
class  Quasimodo
 This object is in charge of actually ringing the local bells (using QAudioOutput and a mixer algorithm) This is done within a separate thread, so that the timing of the bell-ringing won't be affected GUI operations. More...
 
class  RosterWidget
 This widget displays the current table of note assignments, as contained in our NoteAssignmentsMap. More...
 

Enumerations

enum  { CHOIR_DATABASE_SCORE = 0, CHOIR_DATABASE_PLAYBACKSTATE, CHOIR_DATABASE_ROSTER, NUM_CHOIR_DATABASES }
 
enum  {
  CHOIR_COMMAND_TOGGLE_NOTE = 1668245874, CHOIR_COMMAND_SET_SONG_FILE_PATH, CHOIR_COMMAND_SET_CHORD, CHOIR_COMMAND_INSERT_CHORD,
  CHOIR_COMMAND_DELETE_CHORD, CHOIR_COMMAND_PLAY, CHOIR_COMMAND_PAUSE, CHOIR_COMMAND_ADJUST_PLAYBACK,
  CHOIR_COMMAND_TOGGLE_ASSIGNMENT, CHOIR_COMMAND_UNASSIGN_ORPHANS, CHOIR_COMMAND_REVIEW_ASSIGNMENTS, CHOIR_COMMAND_SET_STRATEGY,
  CHOIR_COMMAND_NOOP, CHOIR_COMMAND_PEER_ONLINE, CHOIR_COMMAND_PEER_OFFLINE
}
 
enum  { CHOIR_REPLY_GUI_UPDATE = 1668444268, CHOIR_REPLY_LATENCIES_TABLE, CHOIR_REPLY_NEW_SENIOR_PEER }
 
enum  {
  CHOIR_NOTE_E6 = 0, CHOIR_NOTE_D6, CHOIR_NOTE_C6, CHOIR_NOTE_B5,
  CHOIR_NOTE_A5, CHOIR_NOTE_G5, CHOIR_NOTE_F5, CHOIR_NOTE_E5,
  CHOIR_NOTE_D5, CHOIR_NOTE_C5, CHOIR_NOTE_B4, CHOIR_NOTE_A4,
  CHOIR_NOTE_G4, CHOIR_NOTE_F4, CHOIR_NOTE_E4, CHOIR_NOTE_D4,
  CHOIR_NOTE_C4, CHOIR_NOTE_B3, CHOIR_NOTE_A3, CHOIR_NOTE_G3,
  CHOIR_NOTE_F3, NUM_CHOIR_NOTES
}
 Our enumeration of supported notes, and their numeric indices. More...
 
enum  { MUSIC_TYPE_MUSIC_SHEET = 1836413795, MUSIC_TYPE_PLAYBACK_STATE, MUSIC_TYPE_ASSIGNMENTS_MAP }
 
enum  { DEFAULT_MICROSECONDS_PER_CHORD = 250000 }
 
enum  { ASSIGNMENT_STRATEGY_AUTOMATIC = 0, ASSIGNMENT_STRATEGY_ASSISTED, ASSIGNMENT_STRATEGY_MANUAL, NUM_ASSIGNMENT_STRATEGIES }
 Our various strategies for keeping notes assigned to bells, as peers come online and go offline. More...
 

Functions

const char * GetNoteName (uint32 noteIdx)
 Given a CHOIR_NOTE_* value, returns a human-readable description of the note (e.g. More...
 
String GetPeerNickname (const ZGPeerID &pid, const ConstMessageRef &optPeerInfo)
 Given a peer's ID and his optional info, returns a human-readable ID string for him. More...
 
void UpdateNoteHistogram (uint64 chordVal, bool isAdd, Hashtable< uint8, uint32 > &histogram, uint64 &bitchord)
 

Variables

const String CHOIR_NAME_CHORD_INDEX
 
const String CHOIR_NAME_CHORD_VALUE
 
const String CHOIR_NAME_NOTE_INDEX
 
const String CHOIR_NAME_WRAPPED_MESSAGE
 
const String CHOIR_NAME_MICROS_PER_CHORD
 
const String CHOIR_NAME_LOOP
 
const String CHOIR_NAME_SONG_FILE_PATH
 
const String CHOIR_NAME_PEER_NICKNAME
 
const String CHOIR_NAME_PEER_ID
 
const String CHOIR_NAME_PEER_INFO
 
const String CHOIR_NAME_PEER_LATENCY
 
const String CHOIR_NAME_STRATEGY
 
 ChoirSession
 
 MusicDatabaseObject
 
 MusicSheet
 
 NoteAssignmentsMap
 
 PlaybackState
 

Detailed Description

The choir namespace contains the code specific to the ZGChoir demonstration application.

The choir namespace is a superset of the zg namespace, which is itself a superset of the muscle namespace

Enumeration Type Documentation

anonymous enum
Enumerator
DEFAULT_MICROSECONDS_PER_CHORD 

Definition at line 59 of file MusicData.h.

anonymous enum

Our various strategies for keeping notes assigned to bells, as peers come online and go offline.

Enumerator
ASSIGNMENT_STRATEGY_AUTOMATIC 
ASSIGNMENT_STRATEGY_ASSISTED 
ASSIGNMENT_STRATEGY_MANUAL 
NUM_ASSIGNMENT_STRATEGIES 

Definition at line 64 of file MusicData.h.

anonymous enum
Enumerator
CHOIR_DATABASE_SCORE 
CHOIR_DATABASE_PLAYBACKSTATE 
CHOIR_DATABASE_ROSTER 
NUM_CHOIR_DATABASES 

Definition at line 11 of file ChoirProtocol.h.

anonymous enum
Enumerator
CHOIR_COMMAND_TOGGLE_NOTE 
CHOIR_COMMAND_SET_SONG_FILE_PATH 
CHOIR_COMMAND_SET_CHORD 
CHOIR_COMMAND_INSERT_CHORD 
CHOIR_COMMAND_DELETE_CHORD 
CHOIR_COMMAND_PLAY 
CHOIR_COMMAND_PAUSE 
CHOIR_COMMAND_ADJUST_PLAYBACK 
CHOIR_COMMAND_TOGGLE_ASSIGNMENT 
CHOIR_COMMAND_UNASSIGN_ORPHANS 
CHOIR_COMMAND_REVIEW_ASSIGNMENTS 
CHOIR_COMMAND_SET_STRATEGY 
CHOIR_COMMAND_NOOP 
CHOIR_COMMAND_PEER_ONLINE 
CHOIR_COMMAND_PEER_OFFLINE 

Definition at line 18 of file ChoirProtocol.h.

anonymous enum
Enumerator
CHOIR_REPLY_GUI_UPDATE 
CHOIR_REPLY_LATENCIES_TABLE 
CHOIR_REPLY_NEW_SENIOR_PEER 

Definition at line 43 of file ChoirProtocol.h.

anonymous enum

Our enumeration of supported notes, and their numeric indices.

These can be used to compute bit-positions within our 64-bit chord values. Note that we only define 21 notes for now; the rest of the 64 bits in each chord are reserved for future expansion.

Enumerator
CHOIR_NOTE_E6 
CHOIR_NOTE_D6 
CHOIR_NOTE_C6 
CHOIR_NOTE_B5 
CHOIR_NOTE_A5 
CHOIR_NOTE_G5 
CHOIR_NOTE_F5 
CHOIR_NOTE_E5 
CHOIR_NOTE_D5 
CHOIR_NOTE_C5 
CHOIR_NOTE_B4 
CHOIR_NOTE_A4 
CHOIR_NOTE_G4 
CHOIR_NOTE_F4 
CHOIR_NOTE_E4 
CHOIR_NOTE_D4 
CHOIR_NOTE_C4 
CHOIR_NOTE_B3 
CHOIR_NOTE_A3 
CHOIR_NOTE_G3 
CHOIR_NOTE_F3 
NUM_CHOIR_NOTES 

Definition at line 21 of file MusicData.h.

anonymous enum
Enumerator
MUSIC_TYPE_MUSIC_SHEET 
MUSIC_TYPE_PLAYBACK_STATE 
MUSIC_TYPE_ASSIGNMENTS_MAP 

Definition at line 53 of file MusicData.h.

Function Documentation

const char* choir::GetNoteName ( uint32  noteIdx)

Given a CHOIR_NOTE_* value, returns a human-readable description of the note (e.g.

"E3")

String choir::GetPeerNickname ( const ZGPeerID &  pid,
const ConstMessageRef &  optPeerInfo 
)

Given a peer's ID and his optional info, returns a human-readable ID string for him.

void choir::UpdateNoteHistogram ( uint64  chordVal,
bool  isAdd,
Hashtable< uint8, uint32 > &  histogram,
uint64 &  bitchord 
)

Variable Documentation

const String CHOIR_NAME_CHORD_INDEX
const String CHOIR_NAME_CHORD_VALUE
const String CHOIR_NAME_LOOP
const String CHOIR_NAME_MICROS_PER_CHORD
const String CHOIR_NAME_NOTE_INDEX
const String CHOIR_NAME_PEER_ID
const String CHOIR_NAME_PEER_INFO
const String CHOIR_NAME_PEER_LATENCY
const String CHOIR_NAME_PEER_NICKNAME
const String CHOIR_NAME_SONG_FILE_PATH
const String CHOIR_NAME_STRATEGY
const String CHOIR_NAME_WRAPPED_MESSAGE

Definition at line 75 of file ChoirSession.h.

Definition at line 104 of file MusicData.h.

Definition at line 107 of file MusicSheet.h.

Definition at line 100 of file NoteAssignmentsMap.h.

Definition at line 116 of file PlaybackState.h.