X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevices%2Fsessionfile.cpp;h=0ba64a9b48cf6ffa4c2e7843bb95cf0a739dea7e;hp=687c52bdcd5a225a29d1cdfaeffac104b7c4c9a3;hb=f4ab4b5c657e5613caba82feaa81a8a400e4f331;hpb=b485408f20c39ae8d05372a5faffe15653c74705 diff --git a/pv/devices/sessionfile.cpp b/pv/devices/sessionfile.cpp index 687c52b..0ba64a9 100644 --- a/pv/devices/sessionfile.cpp +++ b/pv/devices/sessionfile.cpp @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ #include @@ -24,27 +23,33 @@ #include "sessionfile.hpp" +using std::shared_ptr; +using std::string; + namespace pv { namespace devices { -SessionFile::SessionFile(const std::shared_ptr &context, - const std::string &file_name) : - context_(context), - file_name_(file_name) { -} - -std::string SessionFile::full_name() const { - return boost::filesystem::path(file_name_).filename().string(); +SessionFile::SessionFile(const shared_ptr context, + const string &file_name) : + File(file_name), + context_(context) +{ } -std::string SessionFile::display_name(const DeviceManager&) const { - return SessionFile::full_name(); -} +void SessionFile::open() +{ + if (session_) + close(); -void SessionFile::create() { session_ = context_->load_session(file_name_); device_ = session_->devices()[0]; } +void SessionFile::close() +{ + if (session_) + session_->remove_devices(); +} + } // namespace devices } // namespace pv