- Oups, sorry I forgot pause_all() & start_all() functions in last commit :)

- Updated version to v0.9.0beta4
This commit is contained in:
Christophe Dumez 2007-03-08 16:40:02 +00:00
parent bd3bde919d
commit aa6f6161c3
5 changed files with 71 additions and 5 deletions

View file

@ -497,6 +497,28 @@ void bittorrent::setGlobalRatio(float ratio){
}
}
// Pause all torrents in session
void bittorrent::pauseAllTorrents(){
std::vector<torrent_handle> handles = s->get_torrents();
for(unsigned int i=0; i<handles.size(); ++i){
torrent_handle h = handles[i];
if(h.is_valid() && !h.is_paused()){
h.pause();
}
}
}
// Resume all torrents in session
void bittorrent::resumeAllTorrents(){
std::vector<torrent_handle> handles = s->get_torrents();
for(unsigned int i=0; i<handles.size(); ++i){
torrent_handle h = handles[i];
if(h.is_valid() && h.is_paused()){
h.resume();
}
}
}
// Add uT PeX extension to bittorrent session
void bittorrent::enablePeerExchange(){
s->add_extension(&create_ut_pex_plugin);