I am creating a simple ambient/explorer platformer. Because I want the player to only be able to see a new area once they have reached it, I decided to split up the world in rooms. However, I also want to implement a slight parallax-effect.
These effects always manage to look awesome.
How do I create a smooth camera movement for this?
The code you posted up there probably produces a kind of "snappy" camera movement as the player is walking around.
Keep track of where your camera is and where it needs to be next, and update it every frame by a tiny amount. In other words, perform interpolation from camera's currentPosition to nextPosition over time. This will create the smooth effect.
From here on, it's easy to clamp the camera to the sides of the room - make sure your nextPosition is within the boundaries of the room.
For these types of effects, I usually write a Camera Animator class with different interpolations.