~audio-recorder/audio-recorder/trunk

« back to all changes in this revision

Viewing changes to src/dbus-skype.c

  • Committer: Osmo Antero
  • Date: 2011-09-18 09:13:24 UTC
  • Revision ID: osmoma@gmail.com-20110918091324-wosqw4bzzhhyqz6m
VersionĀ 0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
 
94
94
    g_skype_mutex = g_mutex_new();
95
95
 
96
 
    // Record ringing sound?
 
96
    // Record ringing sound for incoming calls?
97
97
    if (!conf_get_boolean_value("skype/record_ringing_sound", &g_skype.record_ringing_sound)) {
98
98
        conf_save_boolean_value("skype/record_ringing_sound", FALSE);
99
99
    }
518
518
    // Connect to DBus
519
519
    DBusGConnection *dbus_conn = dbus_player_connect_to_dbus();
520
520
 
521
 
    /* Information from the dbus_monitor.
 
521
    /* Some debug info from the dbus_monitor.
522
522
    $ dbus_monitor
523
523
 
524
524
     method call sender=:1.121 -> dest=:1.124 serial=20 path=/com/Skype/Client; interface=com.Skype.API.Client; member=Notify
527
527
     method call sender=:1.121 -> dest=:1.124 serial=21 path=/com/Skype/Client; interface=com.Skype.API.Client; member=Notify
528
528
       string "CALL 64 STATUS XXX"
529
529
 
530
 
     Note: These are object "method" call, not signals (I've been told).
 
530
     Note: These are object "method" calls, not signals (I've been told).
531
531
           We must create a GObject type and then setup method callback with dbus_g_object_type_install_info() and
532
532
           dbus_g_connection_register_g_object() functions.
533
533
 
615
615
    // Check if str begins with "ERROR ".
616
616
    if (!str) return FALSE;
617
617
 
618
 
    return  g_str_has_prefix(str, "ERROR ");
 
618
    return g_str_has_prefix(str, "ERROR ");
619
619
}
620
620
 
621
621
gchar *skype_get_version() {
622
622
    // GET SKYPEVERSION
623
623
    // <- SKYPEVERSION 2.1.0
624
624
    gchar *str = skype_get_GET_value("GET SKYPEVERSION");
 
625
 
 
626
    // The caller should g_free() this value
625
627
    return str;
626
628
}
627
629
 
653
655
    gchar *cmd = g_strdup_printf("GET CALL %d STATUS", call_no);
654
656
    gchar *status = skype_get_GET_value(cmd);
655
657
    g_free(cmd);
 
658
 
 
659
    // Caller should g_free() this value
656
660
    return status;
657
661
}
658
662
 
669
673
    gchar *cmd = g_strdup_printf("GET USER %s FULLNAME", skype_id);
670
674
    gchar *name = skype_get_GET_value(cmd);
671
675
    g_free(cmd);
 
676
 
 
677
    // Caller should g_free() this value
672
678
    return name;
673
679
}
674
680
 
679
685
    gchar *cmd = g_strdup_printf("GET CALL %d PARTNER_HANDLE", g_skype.call_no);
680
686
    gchar *caller_name = skype_get_GET_value(cmd);
681
687
    g_free(cmd);
 
688
 
 
689
    // Caller should g_free() this value
682
690
    return caller_name;
683
691
}
684
692
 
688
696
    gchar *cmd = g_strdup_printf("GET CALL %d PARTNER_DISPNAME", g_skype.call_no);
689
697
    gchar *caller_name = skype_get_GET_value(cmd);
690
698
    g_free(cmd);
 
699
 
 
700
    // Caller should g_free() this value
691
701
    return caller_name;
692
702
}
693
703
 
709
719
        s = g_strdup("OUTGOING");
710
720
 
711
721
    g_free(type);
 
722
 
 
723
    // Caller should g_free() this value
712
724
    return s;
713
725
}
714
726
 
719
731
    gchar *target = skype_get_GET_value(cmd);
720
732
    g_free(cmd);
721
733
 
 
734
    // Caller should g_free() this value
722
735
    return target;
723
736
}
724
737
 
832
845
    gchar *my_id = skype_get_user_id();
833
846
    gchar *my_name = skype_get_user_name(my_id);
834
847
 
835
 
    gchar *partner_id = skype_get_partner_id(); // Caller's id
836
 
    gchar *partner_name = skype_get_partner_name(); // Caller name
 
848
    gchar *partner_id = skype_get_partner_id(); // Call partner's id
 
849
    gchar *partner_name = skype_get_partner_name(); // Call partner's name
837
850
 
838
851
    gchar *call_type = skype_get_call_type();
839
852