diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-09-22 10:52:09 +0200 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-09-22 10:52:09 +0200 |
commit | ab24c7ec507478f9993718f773edebaad101a315 (patch) | |
tree | e08208c5233325eab7f9027346caca934f61b8a4 | |
parent | 2c7e9b338de9ac735e0342ea73208385a2659c75 (diff) | |
download | vdr-plugin-dxr3-ab24c7ec507478f9993718f773edebaad101a315.tar.gz vdr-plugin-dxr3-ab24c7ec507478f9993718f773edebaad101a315.tar.bz2 |
add method to add a new section to a region
-rw-r--r-- | spuregion.c | 10 | ||||
-rw-r--r-- | spuregion.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/spuregion.c b/spuregion.c index da36a64..6ad9cca 100644 --- a/spuregion.c +++ b/spuregion.c @@ -39,6 +39,16 @@ uint8_t cSpuRegion::openSections() return usedSections + 1; } +bool cSpuRegion::newSection() +{ + if (usedSections + 1 == MAX_SECTIONS) { + return false; + } + + usedSections++; + return true; +} + sSection *cSpuRegion::section(uint8_t num) { if (usedSections == MAX_SECTIONS) { diff --git a/spuregion.h b/spuregion.h index e22d7f6..b31d1cb 100644 --- a/spuregion.h +++ b/spuregion.h @@ -48,6 +48,7 @@ public: uint16_t endLine; uint8_t openSections(); + bool newSection(); sSection *section(uint8_t num); bool addIndex(tIndex idx); |