~ubuntu-branches/ubuntu/precise/indicator-sound/precise-201111281906

« back to all changes in this revision

Viewing changes to src/player-item.vala

Tags: upstream-0.5.9
ImportĀ upstreamĀ versionĀ 0.5.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
  {
53
53
    debug("PlayerItem::update()");
54
54
    if(data == null){
55
 
      debug("PlayerItem::Update -> The hashtable was null - just leave it!");
 
55
      warning("PlayerItem::Update -> The hashtable was null - just leave it!");
56
56
      return;
57
57
    }
58
58
    
59
59
    foreach(string property in attributes){
60
60
      string[] input_keys = property.split("-");
61
61
      string search_key = input_keys[input_keys.length-1 : input_keys.length][0];
62
 
      debug("search key = %s", search_key);
 
62
      //debug("search key = %s", search_key);
63
63
      Variant? v = data.lookup(search_key);
64
64
      
65
65
      if (v.is_of_type ( VariantType.STRING )){
66
66
        string update = v.get_string().strip();
67
 
        debug("with value : %s", update);
 
67
        //debug("with value : %s", update);
68
68
        if(property.contains("mpris:artUrl")){    
69
69
            // We know its a metadata instance because thats the only
70
70
            // object with the arturl prop            
75
75
        this.property_set(property, update);                      
76
76
      }         
77
77
      else if (v.is_of_type (VariantType.INT32 )){
78
 
        debug("with value : %i", v.get_int32());
 
78
        //debug("with value : %i", v.get_int32());
79
79
        this.property_set_int(property, v.get_int32());
80
80
      }
81
81
      else if (v.is_of_type (VariantType.INT64 )){
82
 
        debug("with value : %i", (int)v.get_int64());
 
82
        //debug("with value : %i", (int)v.get_int64());
83
83
        this.property_set_int(property, (int)v.get_int64());
84
84
      }
85
85
      else if(v.is_of_type ( VariantType.BOOLEAN )){
86
 
        debug("with value : %s", v.get_boolean().to_string());        
 
86
        //debug("with value : %s", v.get_boolean().to_string());        
87
87
        this.property_set_bool(property, v.get_boolean());
88
88
      }
89
89
    }
93
93
  public bool populated(HashSet<string> attrs)
94
94
  {
95
95
    foreach(string prop in attrs){
96
 
      debug("populated ? - prop: %s", prop);
 
96
      //debug("populated ? - prop: %s", prop);
97
97
      int value_int = property_get_int(prop);
98
98
      if(property_get_int(prop) != EMPTY){
99
 
        debug("populated - prop %s and value %i", prop, value_int);        
 
99
        //debug("populated - prop %s and value %i", prop, value_int);        
100
100
        return true;
101
101
      }
102
102
    }