diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/pod.c | 34 | 
1 files changed, 12 insertions, 22 deletions
| diff --git a/examples/pod.c b/examples/pod.c index 156968c..7fd4011 100644 --- a/examples/pod.c +++ b/examples/pod.c @@ -14,7 +14,7 @@  #include <xas/drone.h>  #include <xas/seq.h> -static int drone_id_say(xas_drone_vox *vox, +static int drone_id_say(xas_drone *drone,                          const char *drone_id) {      const char *numbers[10] = {          "zero", "one", "two",   "three", "four", @@ -28,23 +28,23 @@ static int drone_id_say(xas_drone_vox *vox,          char c = drone_id[i];          if (c == '-') { -            if (xas_drone_vox_say(vox, " dash") < 0) { +            if (xas_drone_vox_say(drone, " dash") < 0) {                  goto error_drone_vox_say;              }          } else if (c >= 'a' && c <= 'z') {              c -= 0x20; -            if (xas_drone_vox_sayf(vox, " %c", c) < 0) { +            if (xas_drone_vox_sayf(drone, " %c", c) < 0) {                  goto error_drone_vox_say;              }          } else if (c >= 'A' && c <= 'Z') { -            if (xas_drone_vox_sayf(vox, " %c", c) < 0) { +            if (xas_drone_vox_sayf(drone, " %c", c) < 0) {                  goto error_drone_vox_say;              }          } else if (c >= '0' && c <= '9') {              int n = (int)(c - '0'); -            if (xas_drone_vox_sayf(vox, " %s", numbers[n]) < 0) { +            if (xas_drone_vox_sayf(drone, " %s", numbers[n]) < 0) {                  goto error_drone_vox_say;              }          } @@ -56,7 +56,7 @@ error_drone_vox_say:      return -1;  } -static int drone_part_say(xas_drone_vox *vox, const char *drone_id) { +static int drone_part_say(xas_drone *drone, const char *drone_id) {      const char *id_lines[2] = {          " is obedient.\n",          " is empty.\n" @@ -70,16 +70,16 @@ static int drone_part_say(xas_drone_vox *vox, const char *drone_id) {      int i;      for (i=0; i<2; i++) { -        if (drone_id_say(vox, drone_id) < 0) { +        if (drone_id_say(drone, drone_id) < 0) {              goto error_say;          } -        if (xas_drone_vox_say(vox, id_lines[i]) < 0) { +        if (xas_drone_vox_say(drone, id_lines[i]) < 0) {              goto error_say;          }      } -    if (xas_drone_vox_say(vox, speech) < 0) { +    if (xas_drone_vox_say(drone, speech) < 0) {          goto error_say;      } @@ -145,8 +145,6 @@ int main(int argc, char **argv) {      xas_drone *drone,                  *nurse; -    xas_drone_vox *drone_vox; -      xas_drone_chamber *chamber;      struct timeval cur = { 0, 0 }, @@ -196,17 +194,13 @@ int main(int argc, char **argv) {          goto error_drone_chamber_new;      } -    if ((drone_vox = xas_drone_vox_new(drone)) == NULL) { -        goto error_drone_vox_new; -    } - -    xas_drone_vox_set_speed(drone_vox, 0.75f); +    xas_drone_vox_set_speed(drone, 0.75f); -    if (drone_part_say(drone_vox, argv[1]) < 0) { +    if (drone_part_say(drone, argv[1]) < 0) {          goto error_drone_part_say;      } -    if (xas_drone_vox_save(drone_vox, 0) < 0) { +    if (xas_drone_vox_save(drone, 0) < 0) {          goto error_drone_vox_save;      } @@ -271,7 +265,6 @@ int main(int argc, char **argv) {      xas_seq_play(seq, wave); -    xas_drone_vox_destroy(drone_vox);      xas_drone_chamber_destroy(chamber);      xas_drone_destroy(nurse);      xas_drone_destroy(drone); @@ -285,9 +278,6 @@ error_seq:  error_drone_speech_import_nurse:  error_drone_vox_save:  error_drone_part_say: -    xas_drone_vox_destroy(drone_vox); - -error_drone_vox_new:      xas_drone_chamber_destroy(chamber);  error_drone_chamber_new: | 
 
    