Skip to content

Commit

Permalink
More on settings new API.
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed Mar 3, 2015
1 parent 27815dc commit 31f5480
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/com/frostwire/jlibtorrent/SessionSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,20 @@ public int getMaxQueuedDiskBytes() {
public int getSendBufferWatermark() {
return s.get_int(settings_pack.int_types.send_buffer_watermark.swigValue());
}

public int getActiveDownloads() {
return s.get_int(settings_pack.int_types.active_downloads.swigValue());
}

public int getActiveSeeds() {
return s.get_int(settings_pack.int_types.active_seeds.swigValue());
}

public int getConnectionsLimit() {
return s.get_int(settings_pack.int_types.connections_limit.swigValue());
}

public int getMaxPeerlistSize() {
return s.get_int(settings_pack.int_types.max_peerlist_size.swigValue());
}
}
24 changes: 24 additions & 0 deletions src/com/frostwire/jlibtorrent/SettingsPack.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,28 @@ public String getString(int name) {
public void setString(int name, String value) {
sp.set_str(name, value);
}

public void setDownloadRateLimit(int limit) {
sp.set_int(settings_pack.int_types.download_rate_limit.swigValue(), limit);
}

public void setUploadRateLimit(int limit) {
sp.set_int(settings_pack.int_types.upload_rate_limit.swigValue(), limit);
}

public void setActiveDownloads(int limit) {
sp.set_int(settings_pack.int_types.active_downloads.swigValue(), limit);
}

public void setActiveSeeds(int limit) {
sp.set_int(settings_pack.int_types.active_seeds.swigValue(), limit);
}

public void setConnectionsLimit(int limit) {
sp.set_int(settings_pack.int_types.connections_limit.swigValue(), limit);
}

public void setMaxPeerlistSize(int limit) {
sp.set_int(settings_pack.int_types.max_peerlist_size.swigValue(), limit);
}
}

0 comments on commit 31f5480

Please sign in to comment.